In article <161164987028.20040805090540 / soyabean.com.au>, Gavin
Sinclair <gsinclair / soyabean.com.au> wrote:

> Which do you prefer?
> 
>    (1..10).map { |n| n ** 2 }
> 
>    (1..10).map( lambda { |n| n ** 2 } )

I prefer a light-weight syntax for something as commonly used as
anonymous functions. On the other hand, I still don't know why {|n| n
** 2} can't simply create a proc object. 

> Please remember Joel's "percent-case" solution, extensively using
> blocks.  That was nothing if not expressive.  

Yes, a beautiful example of the flexibility of Ruby. But I don't see
how having both blocks and proc objects improves Ruby's expressiveness.


> Ruby can be bent into
> 1000 different shapes, primarily thanks to blocks.  

Plenty of languages have blocks, but fewer languages could build
declarative structures as nicely as Joel was able to do. You also need
instance_eval and it helps a lot if the syntax is fairly free-form so
you can omit parenthesis in function calls.

> > Implicitly passing arguments seems actively bad and using "yield lhs
> > rhs" seems worse than using "compare.call lhs rhs".
> 
> Same comments as above apply.  "Yield" is the perfect English word to
> describe the behaviour.

Sure, it's a good word to describe what the interpreter will do when it
hits that line, but it completely fails to describe the more important
semantic behavior. And if the language already has proc objects why
bother supporting yield?

  -- Jesse