Why Ruby?

spir denis.spir at gmail.com
Sat Dec 18 23:29:37 PST 2010


On Sat, 18 Dec 2010 18:13:50 -0800
Walter Bright <newshound2 at digitalmars.com> wrote:

> > you could write:  
> > sort!(@1>@2)(x);  
> [...]
> > I think this idea (or something similar) is worth consideration.  It is 
> > simply a small extension to an already existing feature that would give D 
> > a terser syntax for lambda's than most of the other languages we've been 
> > discussing.  
> 
> but:
> 
>     sort!("a>b")(x);  
> 
> is just as short! And it already works.

Short, but wrong. I mean conceptually. In-code string representation of code is wrong. I cannot explain why, but something in me refuses that. Seems I'm not the only one.

What's the point? Dunno exactly, but I won't ever use this form. Reminds me of magic Basic
	f = input("function? ")		eg: "2*x + 3"
	FOR x = 1 TO 1000
	    y = eval(f)
	    plot(x,y)
	ENDIF


Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d mailing list