Basic mini-oof.fs Usage

There is a base class (class, which allocates one cell for the object pointer) plus seven other words: to define a method, a variable, a class; to end a class, to resolve binding, to allocate an object and to compile a class method.

object ( – a-addr  ) mini-oof “object”

object is the base class of all objects.

method ( m v "name" – m’ v  ) mini-oof “method”

Define a selector.

var ( m v size "name" – m v’  ) mini-oof “var”

Define a variable with size bytes.

class ( class – class selectors vars  ) mini-oof “class”

Start the definition of a class.

end-class ( class selectors vars "name" –  ) mini-oof “end-class”

End the definition of a class.

defines ( xt class "name" –  ) mini-oof “defines”

Bind xt to the selector name in class class.

new ( class – o  ) mini-oof “new”

Create a new incarnation of the class class.

:: ( class "name" –  ) mini-oof “colon-colon”

Compile the method for the selector name of the class class (not immediate!).