[Gridflow-dev] ping (fwd)

Tom Schouten doelie at zzz.kotnet.org
Wed Sep 15 03:26:04 EDT 2004


> [ object message ]
> 
> vs
> 
> variable obj
> : bound-message obj @ message ;
> 
> and only using the 'bound-message' word
> 


i've been thinking about that some more and i found a nice solution:

* class represented as a forth dictionary. these can be chained, so subclasses are supported
* object represented as a 'binder', which means it modified the meaning of the next mode
  and either does a method lookup if executed at runtime, or does a lookup and compiles the execution token.

creating an object can be done by creating a binder word containing
the object instance.

the syntax so becomes:

binder message

with message from the class' shared attribute list.

looks like 'real' OO :)

that's about all i need. and it will be fast. the only problem is that
different namespaces make the forth tree-structured, so the dictionary
does not behave as a stack any more.

but, because this already is the case for pd objects, this should be ok.
so this will make my object model 'real' i.e.: a separate name space for
shared attributes.

this is dict == stack is actually a very nice concept of forth: you can 
compile temporaray code at runtime and discard it when your done, as long 
as you use a linear execution model. take with that that compilation is 
very fast in forth.



More information about the Gridflow-dev mailing list