property syntax strawman

grauzone none at example.net
Sun Aug 2 20:27:13 PDT 2009


Frank Benoit wrote:
> KennyTM~ schrieb:
>> Frank Benoit wrote:
>>> Or how about making it a single method?
>>>
>>> bool empty=(bool* value){
>>>     if( value ) _empty = *value;
>>>     return _empty;
>>> }
>>>
>>> The compiler rewrites the calling code to either pass the address or
>>> null.
>> So properties can't be used in SafeD?
> 
> Hm, right pointers are not allowed there. So the "in" operator for AAs
> is also disallowed? That surprises me.

You could allow pointers in SafeD. You just can't allow pointer 
arithmetic, unless a pointer carries information on the upper and lower 
bounds of the memory block.

By the way, the -safe in dmd2 switch doesn't seem to do anything yet and 
allows unsafe pointer operations.



More information about the Digitalmars-d mailing list