Property discussion wrap-up
Rob T
alanb at ucora.com
Tue Jan 29 13:31:59 PST 2013
On Tuesday, 29 January 2013 at 18:54:09 UTC, H. S. Teoh wrote:
[...]
>
> We'd have to move width and height inside the AreaProp struct
> to make
> this work, but then we're back to square one (you'd need
> @property to
> implement .area inside AreaProp).
>
>
> T
Yes that's true, and I know structs as they currently stand will
need some changes to make this work, but more likely we'll have
to introduce a new kind of struct to deal with situations like
this.
Zach the Mystic mentions a situation where we wrap not the data,
but only the functions around a struct-like property object, that
way it contains no data of its own, does not need a "this" or a
constructor or destructor. The idea extends past just
implementing properties, and into implementing "smart functions"
that can be used in more generalized ways.
--rt
More information about the Digitalmars-d
mailing list