![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

While trying to convert some code from another object oriented forth
system to swoop I've run into an apparent problem, with dfining
words.
The following code illustrates the problems. I can't find any way to
get it to compile, although I think that it ought to work.
I've modified this endlessly, but I'm posting the original here as
this is a pretty clean example of the problem.
Gene
\ test defining words in class
class myClass
variable myVar
\ Test CREATE DOES>
: add CREATE ,
DOES> @ myVar +! ;
1 add in
-1 add out
\ Redefine : ;
: my: : POSTPONE in ;
: my; POSTPONE out POSTPONE ; ; IMMEDIATE
\ Should be same as : foo in ... out ;
my: foo myVar ? my;
my: bar myVar ? foo my;
my: foobar foo bar my;
end-class
myClass BUILDS x
: try x foo x bar x foobar ;
try
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Mon Dec 17 2001 - 08:24:22 PST
This archive was generated by hypermail 2.2.0 : Sat Nov 22 2008 - 03:04:20 PST