property-like data members
spir
denis.spir at gmail.com
Mon Jan 3 05:34:22 PST 2011
On Mon, 03 Jan 2011 00:55:47 -0500
"Robert Jacques" <sandford at jhu.edu> wrote:
> On Sun, 02 Jan 2011 05:29:48 -0500, spir <denis.spir at gmail.com> wrote:
> > Hello,
> >
> > Using properties allows travesting a method call into direct data
> > access. What if the underlying member actually is plain data? Would it
> > be possible to provide a real data member where the language expects a
> > property (for instance as range empty & front properties)?
>
> Yes, see the Uniform access principle
> (http://en.wikipedia.org/wiki/Uniform_access_principle). (Though UAP
> hasn't been discussed much on the newsgroup)
Thank you, Robert for the pointer. Actually, I know this principle a bit; but would it be hard to implement it for d:
* maybe for properties only,
* if the data member is marked as (pseudo)property
?
(The latter condition to give a hint to the compiler that member name & type coincidence are intended.)
Genis
-- -- -- -- -- -- --
vit esse estrany ☣
spir.wikidot.com
More information about the Digitalmars-d
mailing list