[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help