Forums

Lambdas

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: Lambdas

Postby Charles » Sat Apr 11, 2009 1:24 pm

By the way, "int32" is the default for "int". Also "i = 0" is equivalent to "i as int = 0".
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Lambdas

Postby Csaba » Sat Apr 11, 2009 1:44 pm

Hi Chuck

Thank you for the rapid answer. as noted above, I have corrected a number of other trivial errors in the first version of the code.

Still has an errror, I will come back if I can't solve it.

BUG or design choice?

The sum of even numbers is correctly 30, not 20 as shown in my output

The problem is the for loop:

Code: Select all
      for i in lowerLimit : upperLimit
         print i
         if doSum(i)
            sum += i
      return sum

i=upperLimit is not printed, the test is apparently i<upperlimit, not i<=upperlimit.
Should not upperlimit be included?

I'm using the previos 1 mars version.

Regards
Csaba
Csaba
 
Posts: 42

Re: Lambdas

Postby Charles » Sat Apr 11, 2009 4:42 pm

jonathandavid wrote:This blog post is worth a read.

http://unlimitednovelty.com/2009/03/ind ... ortem.html

I post it in this thread because it talks about multi-line lambdas.

Thanks for the link. We have blocks in Cobra and they seem to work just fine despite having an indentation-based syntax like Python. I didn't conclude that we needed any change to our syntax, at least in this realm.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Previous

Return to Discussion

Who is online

Users browsing this forum: No registered users and 92 guests

cron