Page 2 of 2

Re: Lambdas

PostPosted: Sat Apr 11, 2009 1:24 pm
by Charles
By the way, "int32" is the default for "int". Also "i = 0" is equivalent to "i as int = 0".

Re: Lambdas

PostPosted: Sat Apr 11, 2009 1:44 pm
by Csaba
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

Re: Lambdas

PostPosted: Sat Apr 11, 2009 4:42 pm
by Charles
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.