Lambda syntax, etc

Chris Nicholson-Sauls ibisbasenji at gmail.com
Thu Feb 5 12:54:17 PST 2009


BCS wrote:
> 
> Why use this:
> 
> "func(someInt) { |a,b| return a+b; };"
> 
> when you can reuse syntax and get this for the same amount of typeing
> 
> "func(someInt) (a,b){ return a+b; };"
> 
> 

While I know the compiler could (should) know the difference easily 
enough, my eyes want to parse that as a chained call followed bizarrely 
by a naked block, rather than a block.

That said, I've always found blocks to be one of Ruby's niftiest 
features (I do a fair bit of Ruby hackage on the side), and would love 
to see something like it in D2.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d mailing list