From: Robert Dober Date: 2008-05-29T19:13:29+09:00 Subject: Re: OOP in Ruby? On Wed, May 28, 2008 at 11:24 AM, Dave Bass wrote: > I suppose the need to prepend "lambda" is a good thing in that it gives > you the flexibility of choosing whether you want to make your block into > an object or not, whereas in Smalltalk presumably all blocks are > automatically objects. There may be some small overhead associated with > this, I don't know. I am not sure, is it not simply a question of optimization, assume this case def a &blk end a {} Ruby could not create an object for {}, but does it, I do not think so for 1.8, maybe in 1.9? Same thing in Smalltalk ... [ :i | i + 1 ]. ... Smalltalk could as well not compile this code at all or create a NOP, probably most Smalltalk implementations will ignore it I guess > > Declaring blocks with "lambda" is a bit like declaring variables before > you can use them, something I miss with Ruby. And I am missing your unit tests, that said it might be a good feature safeguarding you against typos in quick hacks sometimes. Overall I still think it is not worth it, maybe your methods are a tad too long too? Cheers Robert