[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help