[gforth] / gforth / mini-oof.fs  

gforth: gforth/mini-oof.fs

File: [gforth] / gforth / mini-oof.fs (download)
Revision: 1.8, Sat May 26 10:20:01 2012 UTC (12 months, 3 weeks ago) by pazsan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +4 -2 lines
Block size made configurable (not completed)
Float and double number separators configurable (see VFX)

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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help