[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs

File: [gforth] / gforth / mini-oof.fs (download)
Revision: 1.4, Sat Oct 10 10:28:34 1998 UTC (14 years, 7 months ago) by pazsan
Branch: MAIN
CVS Tags: v0-4-0
Changes since 1.3: +1 -1 lines
Changed virtual method table pointer in dictionary objects to be compatible with
the other OO packages (VMT-pointer on first cell)

You need a new kernel.fi to recompile the kernel

: 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 , 1 cells +LOOP
  cell+ dup cell+ r> rot @ 2 cells /string move ;
: defines ( xt class "name" -- ) ' >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