[REBOL] Re: Help me, Obi Reb Kenobi, you're my only hope!
From: rotenca:telvia:it at: 2-Sep-2002 18:08
Hi Ladislav,
> 1a) THROW. My DEFAULT2 function "works" as follows:
>
> default2/good [1 2 throw first block2 3] ["caught"] ["passed"]
> ** Throw Error: ** Script Error: Out of range or past end
> ** Near: first []
>
> i.e. it isn't able to catch this kind of error. The ISR? function seems to
> not notice there was an error.
[...]
> , i.e. the ISR? function "creates" an artifact.
>
> For RETURN and BREAK I obtained equivalent results.
I wanted to catch throw (without catch), return (out of function) and break
(out of a loop).
I left to the user what to do with them.
If you think they must be errors in the Default function, the isr? func should
return true:
if none? res [return true]
instead of
if none? res [prin "control detected " return false]
> I would prefer to have the ability to catch even BREAK, RETURN and THROW
> errors, which I cannot do now (AFAIK!).
If one wants the throw/break/return error! object in the isr? function, he
must re-create it :-(
But attention, the no-loop error is a special error. If this is standard:
error? do does [return make error! [throw no-function]] ;== true
this is not:
>> error? do does [return make error! [throw no-loop]]
** Throw Error: Nothing to break
** Near: return make error! [throw no-loop]
The break error! is third class! :-)
> Ciao
> Ladislav
---
Ciao
Romano