>> help protect-system
Protect all system functions and the system object from redefinition.
Arguments:
Refinements:
    /locals
        vals --
        words --
        word --
>> protect-system
>> print: func [a] [a + 3]
** Script Error: Word print is protected, cannot modify.
** Where: print: func [a] [a + 3]

For more info, see:
                %notes.html

Andrew Martin
With great power, comes great responsibility...
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
-><-


----------
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: [REBOL] REBOL  Native Redefine Problem
> Date: Wednesday, 22 December 1999 9:44 AM
> 
> The console session below shows corruption of
> the help function following a re-definition of print.
> 
> It may always be unwise? to redefine a native function,
> but if so it would be nice to receive a warning when doing it.
> 
> Script: "REBOL Extended Definitions" (3-Sep-1999/17:55:08)
> Script: "User Preferences" (20-Dec-1999/18:58:35)
> >> print system/version
> 2.2.0.3.1
> >>
> >> ? form
> Converts a value to a string.
> Arguments:
>     value -- The value to form
> >>
> >> print: func [a ] [a + 3]
> >> print 4
> == 7
> >> type? :print
> == function!
> >>
> >> ? form
> ** Script Error: Cannot use add on string! value.
> ** Where: a + 3
> >>

Reply via email to