File:  [gforth] / gforth / mini-oof.fs
Revision 1.7: download - view: text, annotated - select for diffs
Wed Aug 23 21:03:51 2000 UTC (19 years, 5 months ago) by anton
Branches: MAIN
CVS tags: v0-7-0, v0-6-2, v0-6-1, v0-6-0, v0-5-0, HEAD
Documentation changes
renamed general push-order to >order, objects push-order to class>order,
        drop-order to class-previous

    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: : defines ( xt class "name" -- ) ' >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>