--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
I'm willing to bet you can pull off something along the lines of
@:build(pack.BuildMacro.extendEnum(BaseEnum)) enum ChildEnum
{
NewConst;
}
See http://haxe.org/manual/macros/build
Simon
The common way to extend an enum is the to do the following :
enum First {
A;
B;
C;
}
enum Second {
F( f : First );
D;
E;
F;
}
This way you can do use "D" or "F(B)", and it still respect the type system.
Best,
Nicolas
For the sake of type safety, I suggest a slight enhancement:
enum Foo<T> {
A;
B;
C;
SUB_TYPE(value:T); // Use with custom values to extend.
}
And then T can for example be an enum.
Regards,
Juraj