DIP23 draft: Fixing properties redux

TommiT tommitissari at hotmail.com
Sun Feb 3 21:03:39 PST 2013


On Monday, 4 February 2013 at 04:45:27 UTC, Jonathan M Davis 
wrote:
> On Sunday, February 03, 2013 03:16:08 Andrei Alexandrescu wrote:
>> Destroy.
>
> Another thing to consider would be to allow putting @property 
> on a variable
> with the idea that variables marked as such would not be usable 
> in any
> situation where a property function wouldn't be - such as 
> taking their address
> or passing them by ref. [..]

If we consider a variable marked as @property as a variable whose 
access is restricted, then the following should be also illegal 
uses of it:
1) calling its non-const method
2) mutating its data field

If we consider a variable marked as @property as lowered to 
getter and setter properties, then it doesn't have those 
restrictions. This is what I would advocate.


More information about the Digitalmars-d mailing list