DIP4: Properties

Michel Fortin michel.fortin at michelf.com
Sat Jul 25 04:04:52 PDT 2009


On 2009-07-25 07:00:32 -0400, Michel Fortin <michel.fortin at michelf.com> said:

> 	namespace foo {
> 		int opGet(); // getter
> 		void opAssign(int); // setter
> 		...
> 		int opIndex(int); // foo[1];
> 		void opAddAssign(int); / foo += 1;
> 		void invert(); // special function attached to property
> 	}

I just want to clarify that I used "namespace" as a keyword in this 
example to better illustrate the fact that there is no more magic or 
special syntax under the hood than with a C++ namespace. I'm not 
actually suggesting we use a "namespace" keyword, I think it'd be 
confusing.

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




More information about the Digitalmars-d mailing list