Boo (programming language): Difference between revisions

Content deleted Content added
Code samples: Removing currying example as a whole, since it is not valid
Line 44:
print "done"
 
===[[Currying]]===
plusX = { a as int | return { b as int | return a + b <nowiki>}}</nowiki>
print plusX(3)(4)
 
In English: "plusX is a function taking integer a, which returns another function taking integer b that returns a+b."
 
 
Edit: This isn't currying. This is just a function that returns a function. Currying would be something like:
 
def add(a as int, b as int):
return a + b
 
add_two = add(2)
 
Then, add_two would be a partially applied add, with a=2.
 
add_two(5)
 
Would set b=5, call the function, and return 7.
 
Which Boo cannot do.
 
==See also==