|
[boo]
boo 0.4 is out
[
bamboo
]
Grab yours here!
Tons of improvements in this version, true closures are my favorite one since they allow ruby-like things such as:
In this example the closure is constructed with the do keyword and is automagically passed as the last argument to the each function. Cool or what?
TrackBack
Another way to write this: each(items) do (item as int): would be: each(items, { item as int | value += item }) The second way seems clearer to me - why does "do" create a closure in the first example and it add it to the call to "each"? --Bill Wood, October 10, 2004 07:38 PM
Bill, "do" is just ruby-like syntactic sugar and it does exactly that, it creates a closure and passes it as the last argument for the method invocation on its left. "do" makes it convenient to write little "template method" algorithms: WithTransaction(connection) do (transaction): cheers, --Rodrigo B. de Oliveira, October 10, 2004 08:52 PM
Post a comment
|