[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs

File: [gforth] / gforth / mini-oof.fs (download)
Revision: 1.1, Sun Apr 12 21:49:13 1998 UTC (15 years, 1 month ago) by pazsan
Branch: MAIN
Added mini-oof and example, started docu for that.
Corrected "load" bug in blocks.fs (seems to be that really noone uses blocks.fs).
Minor changes do gforth.el

1 cells Constant cell
: method ( m v -- m' v ) Create  over , swap cell+ swap
  DOES> ( ... o -- ... ) @ over @ + @ execute ;
: var ( m v size -- m v' ) Create  over , +
  DOES> ( o -- addr ) @ + ;
: class ( class -- class methods vars ) dup 2@ ;
: end-class  ( class methods vars -- )
  Create  here >r , dup , 2 cells ?DO ['] noop , cell +LOOP
  cell+ dup cell+ swap @ 2 - cells r> 2 cells + swap move ;
: defines ( xt class -- ) ' >body @ + ! ;
: new ( class -- o )  here over @ allot swap over ! ;
: :: ( class "name" -- ) ' >body @ + @ compile, ;
Create object  1 cells , 2 cells ,

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help