I want to learn a new language...

Hans Fugal hans at fugal.net
Thu Feb 15 15:21:22 MST 2007


On Thu, 15 Feb 2007 at 15:02 -0700, Levi Pearson wrote:
> Hans Fugal <hans at fugal.net> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://plug.org/pipermail/plug/attachments/20070215/e286775e/attachment.bin 


More information about the PLUG mailing list