Forums
Lambdas
13 posts
• Page 2 of 2 • 1, 2
Re: Lambdas
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
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:
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
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
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
13 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 2 guests