byKey and byValue: properties or methods?
Jonathan M Davis
jmdavisProg at gmx.com
Fri Jan 20 01:24:08 PST 2012
On Friday, January 20, 2012 09:29:12 Peter Alexander wrote:
> Can you define what "is logically a property means"? (I assume you meant
> "field" there)
>
> That means different things to different people. For example, in my
> mind, something that is logically a field would have an address. From
> what I can see, byKeys is logically a function (not a field) in every
> way (because it *is* a function).
Usually when discussing properties, taking the address doesn't come into the
equation at all. Part of the reason for this is that many of the languages
which have properties don't allow you to take the address of anything in the
first place. Also, it completely invalidates property anyway, since by
definition, using a property function instead of a member variable makes it so
that you can't take its address (or that if you do, it means something
completely different). So, taking the address of something really can't come
into consideration when talking about properties unless the design requires
that you be able to take its address, in which case it must be an actual
member variable instead of a property function.
So, when talking about something logically acting like a property or a field,
it really can't have anything to do with addressing but rather the other
aspects about how a field is used.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list