__traits proposal: derive hierachy and current-scope-type or something
dennis luehring
dl.soluz at gmx.net
Fri Sep 21 00:18:21 PDT 2007
1. derive-hierachy
class A
class B:A
class C:A
class D:C
* derivedClasses - returns the derived classes
(what about abstract/interface classes?)
__traits( derivedClasses, "A" ) ==> [ B, C ]
__traits( derivedClasses, "C" ) ==> [ D ]
* baseClass (the upward version of derivedClasses)
__traits( baseClass, "D" ) ==> [ C ]
__traits( baseClass, "B" ) ==> [ A ]
should maybe work only in module-scope
2. current-scope-type
class bla
{
scope-type = in class bla
void test()
{
scope-type = in class bla.test()
}
}
maybe with line/module information
only at compile-time
ciao dennis
More information about the Digitalmars-d
mailing list