[REBOL] Re: Please help me to promote REBOL
From: lmecir:mbox:vol:cz at: 11-Nov-2003 20:55
Hi,
[SunandaDH--aol--com] napsal(a):
>Amending my original suggestion to take into account TRY'd code unsetting
>'true or 'set, I'd suggest this for a simple, foolproof way to catch an error:
>don't use 'true, use 1:
>
>if error? error-code: try [do %config.r 1]
> [probe disarm error-code]
>
>if error? error-code: try [print "" 1]
> [probe disarm error-code]
>
>It's harder to unset 1.
>
This may be as safe as you want it to be, but it is not convenient
(append something just to be sure it returns a value). I prefer my
Default function for this purpose instead.
>But the DO'd code could still have messed with 'if or 'error? or 'probe.
>
>That raises a wider question about DOing untrusted code.
>
>If you don't trust it at all, maybe it's better not to DO it in the first
>place.
>
>To seriously stop it messing things up while debugging:
>
>protect-system
>unset 'unprotect
>if error? error-code: try [do %config.r 1]
> [probe disarm error-code]
>
This is not sufficient as I have proven long time ago. (Rebol functions
are mutable, which means, that you can change the behaviour of any
function - even a native without unprotecting the word referring to it. :-(