Maxim Olivier-Adlhoch napsal(a):
> Hi Jonathan,
>
> Welcome to Rebol, hope you have a blast.
>
> what you are experiencing is a subtlety of static run-time loading and
> binding.
Binding is slightly off-topic in this case, "static run-time" is a 
contradictio in adjecto.
> some functions evaluate values and others do not.  in this case,
> compose loads a block and leaves everything within AS-IS.
Wrong. The interpreter loads the block before evaluating the expression. 
Compose does not. (Do you want a proof?)
> so since the
> interpreter has to put the none somewhere as something, it stays a word,
> gets bound to the global definition of none, but isn't evaluated, so its not
> yet a none *value*.
>   

> I have had the same (I thought "strange", at the time) problems with the
> true and false values, which have no lexical form which allows them to be
> explicitly cast as a datatype.
>   
Wrong. Here are the lexical forms of some Rebol values popularly thought 
not having lexical form:

    values: [#[unset!] #[none] #[false] #[true]]

As opposed to that, when writing:

    words: [unset! none false true]

the Words block will just contain words.
> since many of us have lived through this exact issue, I can already warn you
> about loading data files.

> nested blocks, do not recursively get evaluated
> by load, so you can end up with this same problem when saving out blocks and
> objects and stuff.
>   
Confusing. Nested blocks are processed by Load in exactly the same way 
it processes the top-level block. The Load function does just what it is 
supposed to. Example:

    code: load "none [true false]"

produces a block containing one word and a nested block containing two 
words. This means, that Load evaluates neither the nested nor the 
top-level block.
> a good way to identify this is to use the mold/all function which
> *serializes* the data.  in fact, I have replaced probe in my setup so that
> it molds/all in order to clearly identify datatypes.  
This is my Probe version:

probe: func [
    {Prints molded Value. Returns Value.}
    value [any-type!]
] [
    print case [
        not value? 'value ["#[unset!]"]
        error? :value [rejoin ["#[error!" mold/all copy skip second 
disarm :value 2 "]"]]
        true [mold/all :value]
    ]
    return get/any 'value
]

example:

    probe compose [none #[none] (none) false #[false] (false) true 
#[true] (true)]

-L
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to