[REBOL] Ladislav: Interpreter Essay
From: robbo1mark::aol::com at: 16-Oct-2001 3:16
Just read your new Interpretation essay, very good work, I love the way
you can skillfully describe low level REBOL behaviour with high level
descriptions and examples and for this you deserve credit.
Just one minor improvement I would like to suggest to your text.
You stated "When the interpreter finishes evaluation of all values
contained in the block, the last obtained value becomes the result."
Almost true, but not quite. What if the last value in a block is unset!
>> reduce [print "Hello"]
>> do [print "hello"]
In these instances, where the interpreter finds an unset! value it
EXIT's without returning any value, prints the system/console/prompt
and a new evaluation / interpreter loop begins.
My 'do-example function source below should mimic the interpreter
do-example: func [x][x: reduce x if block? x [either unset? last x [exit] [return last
x]] return x]
>> do-example [ 1 print "Hello"]
>> do [ 1 print "Hello" ]
Seems to work fine, otherwise great essay!