include FMS-SI.f :class point ivar x \ instance variable ivar y :m print x ? y ? ;m \ define print method :m get ( -- x y ) x @ y @ ;m :m put ( x y -- ) y ! x ! ;m :m copy ( -- point-obj2 ) self get heap> point dup >r put r> ;m ;class point p1 \ instantiate object p1 23 5 p1 put p1 print p1 copy value p2 \ copy constructor p2 print p2 circle dup >r put r> ;m ;class circle c1 4 5 2 c1 put c1 print c1 copy value c2 c2 print c2