Cool stuff, Ladislav! Someone's going to accuse you of
being a guru here at the rate you're going! (Or maybe
someone just did (; ) I love your "MY" function, saves
typing and works nicely with the way compose works,
allowing you to sculpt the context of words that are
executed in a block. It's wild in REBOL how a given
block of words to be executed could have words that are
bound to a million different places:
Like this silly thing comes to mind:
REBOL [Title: "Mind num'in magic"]
contexts: [a b c d e f g]
i: 0
foreach context contexts [
set context make object! compose [num: (i: i + 1)]
]
;- in this hand we have an ordinary block of
; nums.. nothing up our sleeves.. ;)
nums: [[(num)] [(num)] [(num)] [(num)] [(num)] [(num)] [(num)]]
;- allow me to fan the nums out here on the table:
forall nums [
bind first nums in get first contexts 'self contexts: next contexts
] nums: head nums
;-- Abracadabra!! Alacazoo!
; All the nums come back to you!
print [mold nums "==" mold compose/deep nums]
halt
;=================================
Enough silly business, though...
What happens if someone does something like this in
your secure-do, though?:
secure-do [
security: [file allow] get: func [/any][
do %bad-stuff.r
]
] 'throw [] []
-jeff
> Hi,
>
> the GC problem has a work-around as can be seen below:
>
> secure-do: func [
> {secure script execution} untrusted [block! file!
> string!] {untrusted script} security [block! word!]
> {specify net/file policy} hidden [block!] {words to
> hide} protected [block!] {words to protect} /local
> my-words my result sec-do
> ] [
> ; tell GC about secure-do
> sec-do: :secure-do ...