Proposal: takeFront and takeBack
Tobias Pankrath
tobias at pankrath.net
Wed Jul 4 01:13:19 PDT 2012
On Wednesday, 4 July 2012 at 07:58:11 UTC, Roman D. Boiko wrote:
> On Wednesday, 4 July 2012 at 07:53:32 UTC, Roman D. Boiko wrote:
>> On Wednesday, 4 July 2012 at 07:40:55 UTC, monarch_dodra wrote:
>>> I'll propose "spendFront", which is pretty much the same
>>> thing, but is less loaded. I'm not entirely sure if it
>>> carries the meaning as well? I think it is a worth discussion.
>>
>> I'm not a native speaker, but I feel that "spend" would be a
>> wrong choice.
>>
>> fetchFront was proposed by Dmitry, which I like more than
>> spendFront, but slightly less than consumeFront.
>
> Another option might be "readFront". That's somewhere in the
> middle amond "take", "consume" and "fetch"...
The name must imply that the range will be changed, i.e. after
the call the value is not part of the range anymore.
consume does this, fetch does this, too. read does not, so I see
readFront as a inferior choice. Regarding spendFront: I am not a
native speaker, too, but method names like consumeFront,
fetchFront, popFront etc give me the impression that the caller
is the subject or the one how acts.
spendFront would be the opposite. But I can be completely wrong
here.
More information about the Digitalmars-d
mailing list