r: make object! [
    result: system/words/result
    x: func [] [system/words/x result]
    y: func [] [system/words/y result]
    z: func [] [system/words/z result]
    append: func [str] [system/words/append result str]
]

do bind [
    x
    y
    z
    append "stuff"
] in r 'self

>
>Regards,
>    Gabriele.

Gabriele, you are one sharp cookie!
I always find myself saving your messages,
as they are chock full of superb thinking about Rebol.

This is a very good demonstration of using bind!

That's exactly the kind of thing I was looking for,
Bella!

-galt

p.s. Is there any way to do the same thing, even if
"result" were a local var and not global?

Also, I have 7 functions, and I would need to do this trick in each one.
Is it possible to create some other routine outside the 7 that sets up
the aliasing and then just refer to that function at the top of each of the 7?
It seems like this might be possible!
I can hide the unnecessary bits and without Global vars and so recursion is no
concern ?
Astounding.


Reply via email to