Automatic registration of D function. (not global)
1 static int square(int n) { return n*n; } 2 3 auto ctx = new DukContext(); 4 ctx.register!square.setGlobal("square"); // equivalent to ctx.registerGlobal!square 5 assert(ctx.evalString!int(r"a = square(5)") == 25);
See Implementation
Automatic registration of D function. (not global)