byKey and byValue: properties or methods?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jan 19 16:07:50 PST 2012


On 1/19/12 5:57 PM, Jonathan M Davis wrote:
> On Thursday, January 19, 2012 17:41:44 Andrei Alexandrescu wrote:
>> On 1/19/12 4:43 PM, Steven Schveighoffer wrote:
>>> On Thu, 19 Jan 2012 14:06:00 -0500, torhu<no at spam.invalid>  wrote:
>>>> If the type of byKeys is Range, I would expect to be able to treat it
>>>> like one. Not like one, then another, then another, then another... ad
>>>> infinitum.
>>>
>>> I don't know what you mean. You can treat it like one.
>>>
>>> -Steve
>>
>> It's the rvalue aspect. byKey does not hold a range inside the hashtable
>> (as a member variable would do). Each use of byKey gives you a range
>> that you get to iterate from the beginning.
>
> Well, that's part of the point of properties. They don't have to actually be
> associated with any particular member variable. They just _act_ like the type
> has that public member variable.

Yah, but .length acts to a better extent like an lvalue.

Andrei



More information about the Digitalmars-d mailing list