Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: Andrew Haley <andrew29@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 17:55:49 -0000
dreamwafer@xxxxxxxxx wrote:
On Aug 28, 11:29 am, Andrew Haley <andre...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
[On supporting CREATE .. DOES>]
Other people have done it. It's far from being impossible. I don't
know enough about exactly how your threading scheme works to comment
on how exactly to do it in your system.
For details on ForthScript's threading, see section 5 "Internals
within "ForthScript.pdf" that is part of the Axiom development kit at:
http://www.zillionsofgames.com/cgi-bin/zilligames/submissions.cgi/16178?do=show;id=1452
OK, that all looks pretty conventional. To implement CREATE .. DOES>,
your DOES> should modify the CFA of the most recently created word.
As as example, consider something like
: const create , does> @ ;
DOES> makes the CFA of the most recently created word point into the
middle of the list of CFAs inside CONST, and then DOES> exits from
CONST.
The list of CFAs in CONST looks like this, with "&" meaning the CFA of
the following word:
& CREATE & , & DOES> & (DODOES) & @ & , & EXIT
So, when you do
CONST FOO
you create a new word whose CFA points to the address of (DODOES)
within the body of CONST. The action of (DODOES) is somewhat system
dependent, but it needs to get the address of the parameter field of
the current definition.
Andrew.
.
- Follow-Ups:
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: Andrew Haley
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- References:
- Announcement: Axiom, a Forth Based Universal Game Programming System
- From: dreamwafer
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: Marcel Hendrix
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: dreamwafer
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: Andrew Haley
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: dreamwafer
- Announcement: Axiom, a Forth Based Universal Game Programming System
- Prev by Date: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Next by Date: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Previous by thread: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Next by thread: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Index(es):