Properties and macros on WalterAndrei.pdf.

Robert Fraser fraserofthenight at gmail.com
Wed Sep 5 13:50:16 PDT 2007


Julio César Carrascal Urquijo Wrote:

> Regarding slides 9 through 11 of WalterAndrei.pdf (Uniform Function Call 
>       Syntax) would we be allowed to add properties to a class? For example:
> 
> void foo(Matrix m, char[] value)
> {
> 	// ...
> }
> char[] foo(Matrix m)
> {
> 	// ...
> }
> 
> m.foo = "parrot";
> writefln("It's a dead %s.", m.foo);	//-> It's a dead parrot.
> 
> 
> Now on pages 45 - 51 on AST Macros... Would it be possible to declare a 
> macro as a static member of a class or struct? Example:
> 
> struct Matrix
> {
> 	macro foo(e) { e = 3; }
> }
> 
> Matrix.foo(q);	// I didn't pick the names. Don't blame me for it. ;)
> 
> Thanks

I'm guessing probably not, as the current array-member-function syntax requires parens. I don't think it would make lookup _much_ harder, though.



More information about the Digitalmars-d mailing list