class MyClass { def MyClass() { } def mult(double d) { this.y * d } }; var o = MyClass(); o.f = fun(x,y) { x * y; } assert_true(o.f(3,4) == 12); o.f2 = fun(x) { x * 3; } assert_true(o.f2(3) == 9); o.y = 15; o.f3 = fun(x) { x * this.y; } assert_true(o.f3(4) == 60); assert_true(o.mult(3.0) == 45.0); var o2 = Dynamic_Object(); o2.a = 15 assert_true(o2.a == 15) assert_true(o2["a"] == 15)