Why Ruby?

Lutger Blijdestijn lutger.blijdestijn at gmail.com
Sun Dec 19 10:19:18 PST 2010


foobar wrote:
...
> 
> I wasn't referring to the above which still deals with the syntactic
> issue. I'm talking about making:
> 
> sort!"a >b"(whatever);
> and
> sort(whatever, (a, b) { return a>b; });
> 
> have the same performance. Thus obviating the need for the first form.
> the best form IMO would be of course:
> 
> whatever.sort((a, b) { return a>b; });
> 

Would be nice, but:
- is it even possible (performance-wise)?
- can you enforce this performance constraint? There is a big difference 
between inlining a lexical closure and creating a full one on the heap.
- with template alias parameters, its easy to compose more complex types at 
compile time, you will lose this ability.


More information about the Digitalmars-d mailing list