[gforth] / gforth / objexamp.fs  

gforth: gforth/objexamp.fs

Diff for /gforth/objexamp.fs between version 1.1 and 1.4

version 1.1, Mon Aug 3 17:56:05 1998 UTC version 1.4, Tue Dec 8 22:02:49 1998 UTC
Line 1 
Line 1 
 \ examples and tests for objects.fs  \ examples and tests for objects.fs
   
 \ written by Anton Ertl 1996, 1997  \ written by Anton Ertl 1996-1998
 \ public domain  \ public domain
   
 cr object heap-new print  cr object heap-new print
Line 82 
Line 82 
   
 end-class xcounter  end-class xcounter
   
   
 object class  object class
     foobar implementation      foobar implementation
   
Line 139 
Line 140 
 order  order
 cr  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  object class
     foobar implementation      foobar implementation
   


Generate output suitable for use with a patch program
Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help