File:  [gforth] / gforth / mini-oof.fs
Revision 1.8: download - view: text, annotated - select for diffs
Sat May 26 10:20:01 2012 UTC (7 years, 2 months ago) by pazsan
Branches: MAIN
CVS tags: HEAD
Block size made configurable (not completed)
Float and double number separators configurable (see VFX)

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

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