[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs

Diff for /gforth/mini-oof.fs between version 1.6 and 1.7

version 1.6, Sun Feb 28 22:58:26 1999 UTC version 1.7, Wed Aug 23 21:03:51 2000 UTC
Line 1 
Line 1 
 \ Mini-OOF                                                 12apr98py  \ Mini-OOF                                                 12apr98py
 : method ( m v -- m' v ) Create  over , swap cell+ swap  : method ( m v "name" -- m' v ) Create  over , swap cell+ swap
   DOES> ( ... o -- ... ) @ over @ + @ execute ;    DOES> ( ... o -- ... ) @ over @ + @ execute ;
 : var ( m v size -- m v' ) Create  over , +  : var ( m v size "name" -- m v' ) Create  over , +
   DOES> ( o -- addr ) @ + ;    DOES> ( o -- addr ) @ + ;
 : class ( class -- class methods vars ) dup 2@ ;  : class ( class -- class methods vars ) dup 2@ ;
 : end-class  ( class methods vars -- )  : end-class  ( class methods vars "name" -- )
   Create  here >r , dup , 2 cells ?DO ['] noop , 1 cells +LOOP    Create  here >r , dup , 2 cells ?DO ['] noop , 1 cells +LOOP
   cell+ dup cell+ r> rot @ 2 cells /string move ;    cell+ dup cell+ r> rot @ 2 cells /string move ;
 : defines ( xt class -- ) ' >body @ + ! ;  : defines ( xt class "name" -- ) ' >body @ + ! ;
 : new ( class -- o )  here over @ allot swap over ! ;  : new ( class -- o )  here over @ allot swap over ! ;
 : :: ( class "name" -- ) ' >body @ + @ compile, ;  : :: ( class "name" -- ) ' >body @ + @ compile, ;
 Create object  1 cells , 2 cells ,  Create object  1 cells , 2 cells ,


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help