--- gforth/objexamp.fs 1998/08/03 17:56:05 1.1 +++ gforth/objexamp.fs 1998/12/08 22:02:49 1.4 @@ -1,6 +1,6 @@ \ examples and tests for objects.fs -\ written by Anton Ertl 1996, 1997 +\ written by Anton Ertl 1996-1998 \ public domain cr object heap-new print @@ -82,6 +82,7 @@ m: ( object -- n ) end-class xcounter + object class foobar implementation @@ -139,6 +140,25 @@ int drop-order order cr +\ test override of inherited interface selector +xcounter class + +m: ( object -- n ) + this [parent] val 2* +;m overrides val + +end-class ycounter + +ycounter dict-new constant z +cr +z print cr +z val . cr +z inc +z val . cr +1 z add +z val . cr + +\ test inst-value object class foobar implementation