[EMAIL PROTECTED] wrote:

> 1) what should "code that returns nothing" return?
> 
> There is an approach that is even nowadays present in Rebol (only
> residually, I admit). "Code that returns nothing" can return None.

I expected this answer, but I'm not completely convinced about it.
I'll have to think about that... Also, I'd like to know why Carl
did exclude this solution. Carl?

> 2) What value should "undefined" words have?
> 
> Undefined words shall not have a legal value, which means, that
> any trial to get such a value except for:
> 
> value? 'word
> error? try [get 'word]
> 
> should fire an Error - trying to get a value of an unset word

And what happens when I write:

   values: second system/words

What value should I find there for unset words?

> Is there any remedy in this case? Quite simple, i think. The
> Error! producing functions like Make, To, Try ... shall produce a
> value of Error! datatype, that is already disarmed, ie. doesn't
> threaten to fire any nanosecond. If this were the case, you still
> can have the means to fire the error any time you like:
> 
>     fire make error! {blabla}
> 
> Simple.

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.

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/

Reply via email to