[REBOL] Re: CORE 2.5.2 Bugs/Enhancements
From: rotenca:telvia:it at: 8-May-2002 21:24
Hi Ladislav,
> It is incredible, how easily can Rebol be enhanced sometimes :-) Frank,
> thanks for the idea and Romano, thanks for the generalization. Romano, you
> should send it to feedback.
Yes.
Your tricks with function attributes and errors had to make me think: third of
function is not only an ornamental addition but an active part of the native
code.
In the meanwhile i've written two slow but "safe" (i hope) workarounds (bugs
appreciated):
bindall: func [
"Binds words to a specified context."
words [block! any-word!] "A block of words or single word."
known-word [any-word!] "A sample word from the target context."
/copy "Deep copies block before binding it."
/local t res
][
t: third :bind
change t/words reduce [block! any-word!]
change t/known-word reduce [any-word!]
res: either copy [bind/copy :words :known-word][bind :words :known-word]
change t/words reduce [block! word!]
change t/known-word reduce [word!]
:res
]
inall: func [
"Returns the word in the object's context."
object [object!]
word [any-word!]
/local t res
][
t: third :in
change t/word reduce [any-word!]
res: in object :word
change t/word reduce [word!]
:res
]
---
Ciao
Romano