[REBOL] Ladislav: Interpreter Essay
From: robbo1mark::aol::com at: 16-Oct-2001 3:16
Hello Ladislav,
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"]
Hello
== [unset]
>> do [print "hello"]
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
behaviour.
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"]
Hello
>> do [ 1 print "Hello" ]
Hello
>>
Seems to work fine, otherwise great essay!
Thanks Ladislav.
Mark Dickson