File:  [gforth] / gforth / moofglos.fs
Revision 1.3: download - view: text, annotated - select for diffs
Tue Mar 23 20:24:18 1999 UTC (20 years, 6 months ago) by crook
Branches: MAIN
CVS tags: HEAD
Makefile.in

-- changes to make documentation build with moofglos.fs
   rather than with mini-oof.fs (since the former contains glossary
   entries and the latter does not)

assert.fs blocks.fs debug.fs environ.fs errors.fs extend.fs float.fs
glocals.fs moofglos.fs prim search.fs struct.fs stuff.fs vt100.fs
kernel/args.fs kernel/basics.fs kernel/comp.fs kernel/cond.fs
kernel/files.fs kernel/getdoers.fs kernel/int.fs kernel/io.fs
kernel/nio.fs kernel/paths.fs kernel/require.fs kernel/special.fs
kernel/tools.fs kernel/toolsext.fs kernel/vars.fs

-- many small changes to glossary entries.. I think most are done
   now, so I hope to change far fewer files next time!

doc/gforth.ds

-- many, many small changes and a few large ones. Moved some sections
   around, fixed typos and formatting errors, added new section on
   exception handling, rearranged 'files' section.

    1: \ This contains the same Forth source as mini-oof.fs, but
    2: \ also contains glossary information for the manual.
    3: 
    4: : method ( m v -- m' v ) \ mini-oof
    5:     \G Define a method.
    6:     Create  over , swap cell+ swap
    7:   DOES> ( ... o -- ... ) @ over @ + @ execute ;
    8: 
    9: : var ( m v size -- m v' ) \ mini-oof
   10:     \G Define a variable with @var{size} bytes.
   11:     Create  over , +
   12:   DOES> ( o -- addr ) @ + ;
   13: 
   14: : class ( class -- class methods vars ) \ mini-oof
   15:     \G Start the definition of a class.
   16:     dup 2@ ;
   17: 
   18: : end-class  ( class methods vars -- ) \ mini-oof
   19:     \G End the definition of a class.
   20:     Create  here >r , dup , 2 cells ?DO ['] noop , 1 cells +LOOP
   21:     cell+ dup cell+ r> rot @ 2 cells /string move ;
   22: 
   23: : defines ( xt class "name" -- ) \ mini-oof
   24:     \G Bind @var{xt} to the method @var{name} in class @var{class}.
   25:     ' >body @ + ! ;
   26: 
   27: : new ( class -- o ) \ mini-oof
   28:     \G Create a new incarnation of the class @var{class}.
   29:     here over @ allot swap over ! ;
   30: 
   31: : :: ( class "name" -- ) \ mini-oof colon-colon
   32:     \G Compile the method @var{name} of the class @var{class} (not immediate!).
   33:     ' >body @ + @ compile, ;
   34: 
   35: Create object ( -- a-addr ) \ mini-oof
   36: 1 cells , 2 cells ,
   37: \G @var{object} is the base class of all objects.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>