DukContext.createNamespace

Open a new JS namespace. You can then register symbol inside and call finalize() when its done.

class DukContext
createNamespace
(
string name
)

Examples

1 enum Direction { up, down }
2 
3 auto ctx = new DukContext();
4 
5 ctx.createNamespace("Com")
6     .register!Direction
7     .finalize();
8 
9 assert(ctx.evalString!int("Com.Direction.down") == 1);

Meta