[REBOL] Re: Binding
From: robert:muench:robertmuench at: 19-Nov-2002 9:00
> -----Original Message-----
> From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]
> On Behalf Of Romano Paolo Tenca
> Sent: Monday, November 18, 2002 6:54 PM
> To: [rebol-list--rebol--com]
> Subject: [REBOL] Re: Binding
>> Within predicate and action I would like to have access to id and
>> object. And from action I would like to have access to the local
>> variables from the caller's context. I tried the following:
>
> foreach [id object] list [
> if do bind predicate 'id [do bind action 'id]
> ]
Hi, I wanted to avoid to bring BIND into the loop. So, it really seems
to be that bind is one-shot action. Every word that get's bound to the
local context after BIND isn't accessible from the bounded block. Is
this correct? If so, I'm wondering why? IMO it must be harder to keep
track of the words that the bounded block can access than just to say:
Ok, the block can access all local words (that are present now and will
come up later).
> foreach [id object] list compose/deep [
> if do (predicate) [do (action)]
> ]
Why does compose work here? Will it execute an implicit BIND? The help
just says it will evaluate the parens. Strange thing... Would it work
with REDUCE as well?
BTW: Thanks for the info ;-). Robert