Go to the first, previous, next, last section, table of contents.
-
It is straightforward to pass objects on the stack. Passing
selectors on the stack is a little less convenient, but possible.
-
Objects are just data structures in memory, and are referenced by
their address. You can create words for objects with normal defining
words like
constant
. Likewise, there is no difference
between instance variables that contain objects and those
that contain other data.
-
Late binding is efficient and easy to use.
-
It avoids parsing, and thus avoids problems with state-smartness
and reduced extensibility; for convenience there are a few parsing
words, but they have non-parsing counterparts. There are also a few
defining words that parse. This is hard to avoid, because all standard
defining words parse (except
:noname
); however, such
words are not as bad as many other parsing words, because they are not
state-smart.
-
It does not try to incorporate everything. It does a few things
and does them well (IMO). In particular, I did not intend to support
information hiding with this model (although it has features that may
help); you can use a separate package for achieving this.
-
It is layered; you don't have to learn and use all features to use this
model. Only a few features are necessary (See section Basic Objects Usage,
See section The class
object
, See section Creating objects.), the others
are optional and independent of each other.
-
An implementation in ANS Forth is available.
I have used the technique, on which this model is based, for
implementing the parser generator Gray; we have also used this technique
in Gforth for implementing the various flavours of wordlists (hashed or
not, case-sensitive or not, special-purpose wordlists for locals etc.).
Go to the first, previous, next, last section, table of contents.