File:  [gforth] / gforth / mini-oof.fs
Revision 1.1: download - view: text, annotated - select for diffs
Sun Apr 12 21:49:13 1998 UTC (26 years ago) by pazsan
Branches: MAIN
CVS tags: HEAD
Added mini-oof and example, started docu for that.
Corrected "load" bug in blocks.fs (seems to be that really noone uses blocks.fs).
Minor changes do gforth.el

    1: 1 cells Constant cell
    2: : method ( m v -- m' v ) Create  over , swap cell+ swap
    3:   DOES> ( ... o -- ... ) @ over @ + @ execute ;
    4: : var ( m v size -- m v' ) Create  over , +
    5:   DOES> ( o -- addr ) @ + ;
    6: : class ( class -- class methods vars ) dup 2@ ;
    7: : end-class  ( class methods vars -- )
    8:   Create  here >r , dup , 2 cells ?DO ['] noop , cell +LOOP
    9:   cell+ dup cell+ swap @ 2 - cells r> 2 cells + swap move ;
   10: : defines ( xt class -- ) ' >body @ + ! ;
   11: : new ( class -- o )  here over @ allot swap over ! ;
   12: : :: ( class "name" -- ) ' >body @ + @ compile, ;
   13: Create object  1 cells , 2 cells ,

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>