# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? var xStore := 0 # value: 0 ? var yStore := 0.0 # value: 0.0 ? def autoPropObj { > to getX() :any { return xStore } > to setX(new) :void { xStore := new } > to getY() :any { return yStore } > } # value: ? def &xx := __getPropertySlot(autoPropObj, "x") # value: _::&x ? xx # value: 0 ? xx := 2 # value: 2 ? xStore # value: 2 ? (&xx).isFinal() # value: false ? def &yy := __getPropertySlot(autoPropObj, "y") # value: _::&y ? yy # value: 0.0 ? yy := 3.14 # problem: no such method: __main$autoPropObj#setY/1 ? yStore := 3.14 # value: 3.14 ? yy # value: 3.14 isFinal means will not change, not not-changable-by-this-interface ? (&yy).isFinal() # value: false ? __getPropertySlot(autoPropObj, 43) # problem: the int 43 doesn't coerce to a String x ? __getPropertySlot(autoPropObj, "name syntax test") x # value: _::&"name syntax test"