Why I Use D

Georg Wrede georg at nospam.org
Mon Mar 31 06:48:08 PDT 2008


Scott S. McCoy wrote:
> You also could if array[5 .. -3] implied length -3.
> 
> Similarly. array[-3] could imply array[array.length -3]...

I guess the problem you (and I guess quite a lot of people) ultimately 
have is, the $ looks like a after-thought, sticks in the eye in a 
language that otherwise doesn't use the $ too much, and if one is also 
used to some interpreted language it looks clumsy in this context.

Before $ got this role in D, there were months of (lively) discussion 
about the alternatives. Ultimately, this is short to type, has 
expressive power, is totally obvious as to the intent, and it is easy to 
spot a typo within the brackets.

So, it's not pretty, but to figure out a better alternative would need 
both hard work and luck. :-) And even then, one would have a hard sell 
in demonstrating the advantages, which would have to be significant. 
It's not like the $ issue is the easiest one to get really reopened.



More information about the Digitalmars-d mailing list