January 29, 2009 Re: Please vote once and for good: range operations | ||||
|---|---|---|---|---|
| ||||
Andrei Alexandrescu Wrote:
> It looks like there is endless debate on the naming convention for the range operations. Few saw the obvious bugs in the documentation and examples :o).
>
> So please let's vote once and for all. I will note that I disagree we should ignore what conventions other languages have. Provincialism is the appurtenance of the incult. To that end, I looked around at how some languages define some primitives.
>
> [snip]
>
> So please let's vote once and for all. No choice will please everybody, but I want to settle for something that at least won't displease the most vehement ones :o).
>
>
> Andrei
I don't like first/last. Given a sequence, its first and last elements are fixed (even if the sequence advances), i.e. first, head, toe and last have strict ordering to me.
Head/Toe is acceptable, but I don't like it either. Head has a well-known and unambiguous meaning, which is ok. But toe... (Being a non-native english speaker) I didn't even know its meaning until I looked it up in a dictionary. It sounds more like a head/bar pair to me (i.e. completely unrelated). "Collection's toe element" doesn't tell anything and it takes some time to recall term's meaning in this context (I got used to it a bit, though).
Other property I don't like about 'toe' is that it is shorter than its counterpart - 'head' - I think it should be the same or slightly longer.
That said, best names for me are left(most) and right(most), but they are not listed here :( May I vote for them?
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply