Short list with things to finish for D2

Ellery Newcomer ellery-newcomer at utulsa.edu
Mon Dec 7 19:02:21 PST 2009


On 12/07/2009 08:33 PM, Stewart Gordon wrote:
> bearophile wrote:
> <snip>
>> In Python you usually just omit the value:
>> a[:5] === a[0 .. 5]
>> a[5:] === a[5 .. $]
>
> Which doesn't accommodate anything equivalent to a[$-4 .. $-2].

you mean this?

a[-4:-2]

>
>> Or you can also use None, this can useful because you can put None
>> inside a variable, etc (while in D you can't put $ inside a variable
>> to represent "the end of that array"):
> <snip>
>
> I don't understand this statement at all.

neither can I.

I'll posit a guess though.

c = None;
assert a[1:c] == a[1:]

not seeing any advantage over

c = len(a)

>
> Stewart.




More information about the Digitalmars-d mailing list