On Thu, 15 Feb 2007 at 15:02 -0700, Levi Pearson wrote: > Hans Fugal <[EMAIL PROTECTED]> writes: > > This is because blocks are almost never passed as parameters but as a > > block following the method call. Incidentally, you can wrap up a block > > with lambda/proc or even pass a method, as any parameter you want, and > > then yield it (or call it) explicitly. They're not really relegated to > > only the last position. > > Are blocks almost never used that way because the language makes it > more awkward to do it that way, or because no one would want to do it? > I think Smalltalk is evidence for the former. And I did understand > that you could use blocks and procs and all that stuff in other > positions, but it comes at a syntactic price, and it doesn't seem to > be done very often.
I agree, they're not as cool as smalltalk blocks, but they're a lot cooler than closureless languages. I have written code and seen code to use procs, and perhaps the most natural application is something like an observer registry. I'd say more than anything, the one block at the end covers 90% of the use cases. > > If you vote for Ruby, all your wildest dreams will come true. > > I will undoubtedly be learning Ruby myself at some point, but for > someone like Bryan, I don't know if it's the best choice. Certainly > not a bad one, though. Well, not everyone's dreams should come true. -- Hans Fugal ; http://hans.fugal.net There's nothing remarkable about it. All one has to do is hit the right keys at the right time and the instrument plays itself. -- Johann Sebastian Bach
signature.asc
Description: Digital signature
/* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
