enum OTHER, OPERATION function operation(object o) integer rid = o[OPERATION] if rid!=NULL then return call_func(rid,{}) end if return "no implementation" end function function xthing() return "default implementation" end function function newX() return {1,routine_id("xthing"),2} end function function newY() object res = newX() res[OTHER] = "something else" -- remove delegate: res[OPERATION] = NULL return res end function function zthing() return "delegate implementation" end function function newZ() object res = newX() -- replace delegate: res[OPERATION] = routine_id("zthing") return res end function object x = newX(), y = newY(), z = newZ() ?operation(x) ?operation(y) ?operation(z)