DukContext.register

Automatic registration of D enum. (not global)

  1. DukContext register()
  2. DukContext register()
    class DukContext
    register
    (
    alias Enum
    )
    (
    )
    if (
    is(Enum == enum)
    )
  3. DukContext register()

Examples

1 enum Direction { up = 0, down = 1 }
2 
3 auto ctx = new DukContext();
4 ctx.register!Direction.setGlobal("Direction"); // equivalent to ctx.registerGlobal!Direction
5 assert(ctx.evalString!int(r"a = Direction.down") == 1);

Meta