opCaret to complement opDollar when specifying slices
Steven Schveighoffer
schveiguy at yahoo.com
Mon Jun 4 13:50:39 PDT 2012
On Mon, 04 Jun 2012 16:32:55 -0400, Roman D. Boiko <rb at d-coding.com> wrote:
> On Monday, 4 June 2012 at 20:26:52 UTC, Steven Schveighoffer wrote:
>> On Mon, 04 Jun 2012 16:13:49 -0400, Mehrdad
>>> Can you use "null"?
>>
>> Hm... now that null has its own type, I likely could.
>>
>> I suppose that would map properly to 0.
>>
>> -Steve
> But if the key is non-nullable this might be confusing, or even not
> possible.
Well, you could say that null keys are not allowed. But then it makes no
sense for null not to work in other places.
I really am not sure this works well, I think it would be too confusing.
map[null] = 5; // set the first element to 5?
map[null..4] = 6; // set all the elements with keys before 4 to 6
map!keyType k = null;
map[k..$]; // likely an error.
I really actually think I like using map.begin better than null...
-Steve
More information about the Digitalmars-d
mailing list