[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs


1 : pazsan 1.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 ,

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help