blueeyedpop
07-29-04, 10:29 AM
using the following definition for EVALUATE,
: EVALUATE ( addr n -- )
TIB @ >R
>IN @ >R
#TIB @ >R
2DUP + 0 SWAP C! ( append a null terminator, required by INTERPRET
#TIB !
TIB !
0 >IN !
INTERPRET
R> #TIB !
R> >IN !
R> TIB !
; EEWORD
when I do the following, I would expect that I would interpret the contents of a string.
VARIABLE CHEESE 20 ALLOT
CHEESE 20 ERASE
CHEESE 20 EXPECT
20.000 (implied cr return here to stop EXPECT
CHEESE 6 EVALUATE
returns garbage characters, and does not leave 20.000 on the stack...
What am I doing wrong?
: EVALUATE ( addr n -- )
TIB @ >R
>IN @ >R
#TIB @ >R
2DUP + 0 SWAP C! ( append a null terminator, required by INTERPRET
#TIB !
TIB !
0 >IN !
INTERPRET
R> #TIB !
R> >IN !
R> TIB !
; EEWORD
when I do the following, I would expect that I would interpret the contents of a string.
VARIABLE CHEESE 20 ALLOT
CHEESE 20 ERASE
CHEESE 20 EXPECT
20.000 (implied cr return here to stop EXPECT
CHEESE 6 EVALUATE
returns garbage characters, and does not leave 20.000 on the stack...
What am I doing wrong?