Array Slice Ranges

Kirk McDonald kirklin.mcdonald at gmail.com
Thu Nov 9 01:30:02 PST 2006


Bill Baxter wrote:
> Trevor Parscal wrote:
>> == Quote from Walter Bright (newshound at digitalmars.com)'s article
>>> I have a bit of a problem with .. vs ..., I think they both look too
>>> similar  making it hard to review code for correctness, and I'd have a
>>> hard time remembering which means which, another source of bugs.
>>
>> Perhaps you guys aren't keen on the .. and ...
>>
>> But it would be nice to have some symbol mean "through" in ranges to 
>> acompany the
>> current .. which means "until"
>>
>> Like..
>>
>> 0 _ 5 == 0, 1, 2, 3, 4, 5
>> 0 .. 5 == 0, 1, 2, 3, 4
>>
>> Sorry - I know there's more important things to do.... Just puting my 
>> 2 cents in...
> 
> __ is a legal identifier though, so you'd need spaces to use it generally.
> 

Additionally, this
     1_5
would be interpreted as the number 15, since D ignores underscores that 
appear in the middle of numerical literals.

-- 
Kirk McDonald
Pyd: Wrapping Python with D
http://pyd.dsource.org



More information about the Digitalmars-d mailing list