Happy New Year 2000 to List-Eners!
I intentionally started with blocks/strings as the first nontrivial case.
The next were functions for me (I consider words as the most complicated
datatype with respect to evaluation - because their evaluation is derived
from the evaluation of less complicated datatypes in that respect).
Let's call the present model of function evaluation the Medium Evaluation
Model.
There is a different possibility for the function evaluation:
We can use a Slow Evaluation Model, which is as follows:
(i) functions evaluate to themselves, i.e. are treated as simple
values by the interpreter.
Let's see, what that means:
((:f)) evaluates to the same value as :f, so we are free to replace
subexpressions here.
As a benefit Rebol will use no exceptions when evaluating functions.
The difference:
This model differs from the Medium Evaluation Model in the following case:
do change [(:f)] :f
shall yield :f.
There is a logical question: how can we force Rebol to interpret
functions, i.e. treat their value as code? This is how:
(ii) Evaluation/words:
Words are evaluated somewhat differently than simple values. When a word is
evaluated its assigned value is looked-up and checked for type. If the type
of assigned value is any-function, that function is interpreted... (add
whatever you need to complete the sentence)
This model doesn't solve the puzzles like:
((to word! "a"))
((first [a]))
(('a))
and a lot of others, but some approaches can help even with that...
Ladislav