Why Ruby?

foobar foo at bar.com
Sun Dec 12 06:25:05 PST 2010


I agree with Jacob Carlborg regarding the problem. It would indeed be nice to have better delegates syntax. But, why are we trying so hard to force the same syntax that's used for 'regular' function calls? I'm unconvinced that the suggestions provided are clearer to either the programmer or the compiler. 
We all agree that Ruby has a nice syntax but it too has a _separate_ syntax. 
I therefore suggest to adopt some variant of Ruby's syntax. 
e.g.
foo (a, b) | foo, bar| {
  use(foo, bar);
}

and maybe also: 
collection.each |item| use(item);

in any case, Even though I LOVE Ruby's easiness in this regard, I still feel that this is low priority for D. I'd also like to request to NOT create many different syntax variants like delegate vs. lambda vs. proc vs block ... which add little benefit and lots of unnecessary confusion IMO.


More information about the Digitalmars-d mailing list