Why Ruby?

so so at so.do
Sun Dec 19 15:29:33 PST 2010


On Mon, 20 Dec 2010 01:18:20 +0200, Andrej Mitrovic  
<andrej.mitrovich at gmail.com> wrote:

> int[] a = [ 1, 2, 3 ];
> string[] b = [ "a", "b", "c" ];
> sort!("a[0] > b[0]")(zip(a, b));
>
> or
>
> int[] a = [ 1, 2, 3 ];
> string[] b = [ "a", "b", "c" ];
> sort!(@[0] > @[0])(zip(a, b));
>
> --
>
> auto var = sequence!("a[1] + n-1 + a[0]")(1, 2);
>
> or
>
> auto var = sequence!(@1[1] + n-1 + @1[0])(1, 2);

That syntax can't even differ "a > b" from "b > a", and @ is ugly to be  
used frequently.
On the other hand strings open many doors probably limited by only our  
imagination.
And it is there in the language spec, enabled by tiny template feature,  
passing strings as arguments.

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list