Rebol [
    Author: "Romano Paolo Tenca"
    Date: 16/11/01
    Version: 0.0.1 ""
    File: %gcmask.r
    Purpose: "Functions to execute some code without adding its words to the Global Context"
]
to-mask: func[word [string!]][first to-block word]
use-mask: func [words [block! string!] body [block! string!]][
    if string? words [words: to-block words]
    if string? body [body: to-block body]
    use words bind body 'system 
]
func-mask: func [spec [block! string!] body [block! string!]][
    if string? spec [spec: to-block spec]
    if string? body [body: to-block body]
    func spec bind body 'system 
]
make-mask: func [prot spec [block! string!]][
    if string? spec [spec: to-block spec]
    make prot bind spec 'system 
]
do-mask: func [body [block! string!] /ctx word [word!] "A word of the context to bind body"][
    if string? body [body: to-block body]
    body: bind body 'system
    if ctx [body: bind body word]
    do body
]
;examples: can be deleted
if not value? 'my_local_user [
    ex: [
    use-mask "ext my" "my: 1 ext: 2 print [my ext]"
    x: func-mask "my" "print my"
    x 3
    o: make-mask object! "ext: 100 print ext"
    do-mask "use [my][my: 5 print [my o/ext]]"
    do-mask/ctx "use [my] [my: 6 print ext print [my ext]]" in o 'self
    print ["Searching my in the GC:" in system/words to-mask "my"]
    print ["Searching ext in the GC:" in system/words to-mask "ext"]
    ]
    print system/script/header/purpose
    prin "** Example code:"
    print mold/only ex
    print "** Execution of example code:"
    do ex
    ask "Return to quit, Esc to Shell"
]