Feature Request: "self" keyword to indicate "the current function"

downs default_357-line at yahoo.de
Sat May 3 08:08:01 PDT 2008


This would effectively give us anonymous recursion for comparatively little effort.

Problems: "void test(typeof(self) foo, int bar);". To resolve this case requires infinite recursion support in the type system, or a generic "this type" type at the mangling level.

Or it could just be an error. :p On the other hand, if the above were made to work, we could implement the Y combinator in D. Not that we'd need it at that point. :p

 --downs



More information about the Digitalmars-d mailing list