Is there any way to do this (preferably in D1) with reflection? (ie, without 
having to manually create a conversion func/lookup for every value of every 
enum.)

----------------------
enum Shape
{
    Square, Circle
}
char[] foo(Shape s)
{
    // ?????
}

// Either one of these, I don't really care which
assert(foo(Shape.Square) == "Shape.Square");
assert(foo(Shape.Square) == "Square");
----------------------


Reply via email to