My contribute about evaluation...

We know that code is, in REBOL, just a "sequence" of values. So,
code execution means evaluation of REBOL values. Every REBOL type
evaluates returning something. Here is a list of types and the
corresponding result of evaluation.


error!   Values of type error! are special. The interpreter always
evaluates them, unless they are passed to a function that
explicitly requests a value of type error!:
>> f: func [a] []
>> f make error! "foo"
** User Error: foo.
** Where: f make error! "foo"
>> f: func [a [error!]] []          
>> f make error! "foo"    
>>
The evaluation of values of type error! results in the
interruption of execution and the display of an error message.


datatype!, object!, port!, refinement!, none!, logic!, integer!,
decimal!, money!, time!, date!, char!, tuple!, bitset!, string!,
issue!, binary!, file!, email!, url!, tag!, block!, hash!, list!

All the values of these types evaluate returning themself.


native!, op!, function!, action!   The evaluation of values of
these types return the result of the execution of the respective
function. The execution of a function consists in collecting the
values of the arguments and in the execution of the function's
body. Collecting one argument means evaluating the next value
found in the block of code. E.g.,
    f some-value
means, if f is a function requesting one argument, evaluating
some-value and passing it to f. 


symbol!   I don't know what's this. Perhaps it's here for future
use?


word!   Evaluation of a word results in 1) getting its associated
value and 2) evaluating it, unless it's a word.


set-word!   Evaluation of a set-word results in setting the
corresponding word to the result of the evaluation of the next
value found in the block of code.


get-word!   Evaluation of a get-word returns the value associated
with the corresponding word.


lit-word!   Evaluation of a lit-word results in the corresponding
word.


paren!   Evaluation of a value of type paren! means executing the
code contained in it, and returning the result.


path!   Evaluation of a path means getting the value associated
with the first element of the path (which is always a word) and
applying to it the other elements of the path as "refinements".
The way this is done and the result depends on the type of this
value. (If you're interested, I'll try to explain this in detail
as well.)


set-path!   The result of the evaluation of a set-path depends on
the type of the value associated with the first element of the path 
(which is always a word). See above.


lit-path!   Evaluation of a lit-path results in the corresponding
path value.


Just my 2 cents,
    Gabriele.
-- 
o--------------------) .-^-. (----------------------------------o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC     \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o--------------------) `-v-' (----------------------------------o

Reply via email to