> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> On Behalf Of Gabriele Santilli
> Sent: Tuesday, August 27, 2002 12:39 PM
> To: Robert M. Muench
> Subject: [REBOL] Re: Iterators & Functionids
 
> What about:
> 
>     foreach-record: func ['word records predicate action] [
>         predicate: func reduce [word] predicate
>         action: func reduce [word] action
>         foreach record records [
>             if predicate record [action record]
>         ]
>     ]

Hi, looks good to me. I came up with the following solution:

        forall list [
                object: first list
                if (do bind copy predicate 'list) [do bind copy action
'list]
        ]

Within the predicate & action block you now have access to 'object.
Using bind makes it possible to get access to the local words. I use
copy to avoid destroying the global context binding of the provided
blocks. Robert


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to