[OpenBIOS] Help with some code
programmingkidx at gmail.com
Fri Sep 24 12:00:01 CEST 2010
I'm trying to implement the -> word for setting variables, but it is not working as I hoped. Everything seems find until I reach the first eval word. At that point the evaluated string should make a new word. For some reason, the eval word says that the word can't be found. Here is the code:
\ compile time: 4 -> cat
\ run time: 4 set-cat
\ : set-cat cat ! ;
\ sets values for local variables
: -> ( x - )
\ creates a copy of the variable's name
\ creates the new variable setting word
" : set-"
" ! ;"
\ sets up the new word to be called in place of ->
" postpone "
\ combines two strings together
: $cat2 ( $1 $2 -- $3 )
2 pick over + dup >r alloc-mem >r
2swap tuck r@ swap move ( $2 $1-len )
r@ + swap move ( )
Anybody know what I could be doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenBIOS