home .. forth .. colorforth mail list archive ..

[ColorForth] immediate


Hi List!

First, good news: my OCF (one color Forth) is running
under two platforms: as a 32bit Windows Borland C++
builder app, and as a 16bit Borland C++ 4.52 DOS console
app. The latter incarnation actually makes no use of the
"++" in C.

I'm using C as the assembler here, for now...

I gotta finish some text about it, and i'll put at least
the DOS app onto some homepage, i'll tell you when it's
up. Some of these days. I put it into the public domain.

But first, one question:
for various reasons, i need OO in Forth. I know that's
a little OT here, as it doesn't relate to Color Forth
specifically, but maybe one of the experienced people
here can give me advice:

I'll code an OO extension. And i haven't decided yet
about where to leave the "this" pointer (the pointer
to the object a method has to deal with). Are there
experiences? Shall i
- put it on the data stack?
- on the r-stack?
- on a dedicated "this"-stack?
- in a global variable?

At the moment, i tend to use the last variant, because
often, one and the same objects attributes are used
several times before a call to a different one occurs, 
so the actual "this" wouldn't be switched that often;
thus, thinking of the global variable as a sort of
"interpreter-specific register" makes sense to me.
(Could even give the according words, probably mostly
some word like "this@", a low level implementation if
needed to speed things up)

So, that would result in a sort of "implicit" or "hidden"
this pointer, much like in C++. Not the worst thing to
have, IMHO.

I think it's an important decision to make, and if anybody
has evidence for some experience, pointing to how 
this decision shapes the programs one writes, or which
turned out to be wrong, please let me know.

Thanks!

Dirk

------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.ultratechnology.com