DIP23 draft: Fixing properties redux

Chad Joan chadjoan at gmail.com
Mon Feb 4 19:30:14 PST 2013


On 02/04/2013 05:28 PM, Andrei Alexandrescu wrote:
> On 2/4/13 2:04 PM, Jonathan M Davis wrote:
>> We could save a lot of boilerplate code if we can simply make it
>> variables and
>> property functions guaranteed to be swappable without breaking code.
>
> I think this is quite powerful. The way we can do this is by making
> properties emulate a subset of actual variables.
>
> Andrei

I agree with Jonathan.

Please do not make them a subset.  Make them as identical as possible. 
The subset thing makes them no longer "swappable".  Allow variables to 
be marked with @property to limit them to operations that @property 
functions can do, and make sure @property functions are limited to what 
@property variables can do (ex: no address-of!).  With that in hand, 
they'll be very swappable.


More information about the Digitalmars-d mailing list