PDA

View Full Version : Evaluate


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?

blueeyedpop
07-29-04, 12:23 PM
It turns out EVALUATE is already defined in my version of IsoMax.

THat might have something to do with it. Evaluating a string with 0x00 in it causes a reset though. I wouldn't expect it to crash.

Mike

RMDumse
08-13-04, 04:16 PM
Yes, we added EVALUTE to the kernel, so you don't even have to enter a definition for it now.