Function calls

Michel Fortin michel.fortin at michelf.com
Wed Jan 27 14:06:03 PST 2010


On 2010-01-27 15:54:42 -0500, Andrei Alexandrescu 
<SeeWebsiteForEmail at erdani.org> said:

> Now @property is in. That has created (as I had anticipated) the 
> unresolved issue of choosing between @property or just function for any 
> given parameterless function. Also I need to litter my code with 
> @property. To this day I am not sure whether we made the right decision.

Well, perhaps it'd be better if it was 'property' instead of 
'@property'. I find the distinction between keywords and attributes to 
be pretty arbitrary, almost illogical.

I'm on the side that attributes (those keywords starting with @) should 
be reserved to things you can ignore entirely without preventing the 
program from working. For instance, remove all @safe and @trusted 
attributes from a program and it still works with no change in 
behaviour (except for when an error occurs). 'nothrow', 'pure', 
'final', 'deprecated' should be attributes; '@property' should be a 
regular keyword. Protection attributes could be made attributes too 
since if you remove them all everything still works.

So I think attributes should be reserved to non-essential but useful 
stuff in the language, generally those things adding restrictions 
without changing the semantics.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list