Why I Use D

Leandro Lucarella llucax at gmail.com
Sun Mar 30 12:41:21 PDT 2008


Janice Caron, el 30 de marzo a las 20:11 me escribiste:
> On 30/03/2008, Scott S. McCoy <tag at cpan.org> wrote:
> >  array[5..] and array[..5] seem to make perfect sense to me and get rid of
> > kludge like $.
> 
> But those constructions don't get rid of $ entirely.
> 
> Sure, you'd be able to write array[5..] instead of array[5..$]. But
> you still wouldn't be able to write array[5..-1] instead of
> array[5..$-1]. (Not so in Python, I believe).

In python this is array[5:-1], which seems a lot nicer to me...

I hope D some can do array[5..-1], array[..-4], array[..], etc. a la
Python.

> So it only buys you the luxury of not having to type $ in one very
> special case. In my view, that makes keeping it more consistent than
> dropping it. (And come on - it's only one character!)

Yes, only 1 character but it looks like an ugly hack to me. '$' has no
meaning except in array slices, and what not necessary anyway. I know it's
hard (impossible?) to get rid of it now, but I wanted to say it =)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
22% of the time a pizza will arrive faster than an ambulance in Great-Britain



More information about the Digitalmars-d mailing list