Restrict Class Properties?
Kevin Bealer
kevinbealer at gmail.com
Tue Feb 20 20:14:20 PST 2007
Jarrett Billingsley wrote:
> "Michiel" <nomail at please.com> wrote in message
> news:erfvel$1ivj$1 at digitalmars.com...
>> Could someone please define 'properties'?
>>
>> Is it just the syntax? In that case you can make variables public or use
>> structs.
>>
>> Is it the syntax + the encapsulation? That's what D does now. How would
>> you change it, exactly? Are there more problems than just the 'out'?
>>
>> What are 'real properties'?
>
> True properties would be understood by the compiler as a distinct construct,
> rather than a hackish rewrite of assignment into a call. This would allow,
> among other things, for templated properties; properties as the destination
> of op=, ++, and --; and the abolishment of the '&' when getting the address
> of a function or delegate. As well as preventing such foolishness as
> "writefln = 6;".
Preventing writefln = 6 seems like a small thing (i.e. the chances of
doing this accidentally are low), but I do like the idea of being able
to do ++ or similar. The ".length ++" would be a nice syntactic ability
for arrays and array-like data structures.
Kevin
More information about the Digitalmars-d
mailing list