RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Sep 9 16:04:12 PDT 2008


Steven Schveighoffer wrote:
> "Derek Parnell" wrote
>> On Tue, 09 Sep 2008 10:45:53 -0500, Andrei Alexandrescu wrote:
>>
>>
>>>          ref int left() { ... }
>> Is "left" a "movement in a specific direction" as in "go left at the next
>> lights" or the "amount of stuff left over"? It is a bit ambiguous. Even if
>> it is a direction, is it moving towards the first or the last item? It is
>> not self-evident. As a user of the Latin alphabet I'd assume it was going
>> towards the first item but a Hebrew or Arabic users might assume it was
>> heading towards the end.
> 
> It means 'left-most element in the range'.  It gets you the first element in 
> the range (i.e. the next element to iterate) without modifying the range.
> 
> I agree that it is very misleading, but I think Andrei is exploring other 
> possibilities (see other threads).

Finally the coin dropped on the Arabic/Hebrew cultural thing. I don't 
think they'd be offended. This is not writing. Left is left and right is 
right in math.

But yes... first and last are in I guess. I'd also like *r as a shortcut 
for r.first, as it will be no doubt used very intensively.


Andrei


More information about the Digitalmars-d-announce mailing list