Hi Gabriele,

>
> And what happens when I write:
>
>    values: second system/words
>
> What value should I find there for unset words?

This really is a tough question.

Solution #1:

If Unset didn't exist, you could use eg.:

wordval: func [
    {returns a block containing a value of a word}
    word [word!]
] [
    either value? word [
        reduce [get word]
    ] [
        none
    ]
]

and instead of the value of a word, you could use its Wordval for
such purpose.

Solution #2: If you prefer the situation, where you can get the
value of any word, then any unitialized word can be initialized to
None.

Solution #3: you don't have

    second system/words

you have only

    first system/words

which is enough.

> I prefer that the current behaviour. An error is a bomb ready to
> explode, and it has to explode if you touch it; if you are
> producing and storing an error, you must disarm it; by doing so,
> you make clear that that error! is not a real error (that is, a
> code failure caused by a bug or by incorrect input) but a
> deliberately created one. If you store an armed error! in a
block,
> then it should explode as soon as any function tries to access
it.

That complicates some things with:

    second system/words

too. Moreover, you cannot legally get error as a result of a
computation as in

    error? err: do block

and if you do:

    error? err: try block

, you can never be sure if the result Err you have is a result of
a successful computation or a sign of a disaster.

>
> What is probably needed is a sort-of disarmed-error! datatype
> (currently disarm produces an object!) and a "rearm" function;
> this way you can MAKE ERROR! or MAKE DISARMED-ERROR!, based on
> what you really want.
>
> Just IMHO,
>    Gabriele.
> --
> Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL
Programmer
> Amiga Group Italia sez. L'Aquila --
http://www.amyresource.it/AGI/
>

Regards
    Ladislav




Reply via email to