feature req: extend property syntax func calls to classes, interfaces, primitives? also, final interface methods w. code

Downs default_357-line at yahoo.de
Tue May 22 01:12:34 PDT 2007


Daniel Keep wrote:
> I get the shakes just thinking about how awesome this would be.
> 
> For reference, here's how you do something similar in C#3:
> 
> class test { void foo() { /* do stuff */ } }
> 
> Is the same as:
> 
> class test {}
> void foo(test this) { /* do stuff */ }
> 
> I'm not 100% sure if I like how they require you to explicitly mark
> methods as extensions of a particular type, but if it makes it easier to
> implement for Walter, I can live with it :)
> 
> 	-- Daniel
> 
To prevent a possible misunderstanding, let me clarify that my proposal doesn't make those two ambiguous, nor does it allow classes without _any_ functions.
For obvious reasons, non-final functions will still have to be actually _inside_ the class, if only to allow a valid vtable to be constructed.
So "class test { } void foo(test this) { }" would actually be equivalent to "class test { *final* void foo() { } }".
Hate to disappoint, but there you go ^^
  -- downs



More information about the Digitalmars-d mailing list