[REBOL] word Re:(2)
From: fantam:mailandnews at: 14-Aug-2000 13:31
Yes, you are right, nothing is wrong with this method, on the
contrary, it may be the most elegant solution. I just wanted to
understand how it had to be done with 'bind (see Larry's message), how
you can take an existing word and change its context.
> Fantam wrote:
>> I am confused. Consider this small script:
>>
>> REBOL []
>>
>> block: ["a" "b" "c"]
>> code: [print member]
>> foreach member block [do code]
>>
>> Upon execution, I get :
>>
>> ** Script Error: member has no value.
>> ** Where: print member
>> >>
>>
>> I guess I have to use 'bind or 'use somewhere, but I'm not sure which and
> how.
> What's wrong with this method?
> REBOL/View 0.9.9.3.1 1-Jun-2000
> Copyright 2000 REBOL Technologies. All rights reserved.
> Type DEMO to run demo if it is disabled
>>> block: ["a" "b" "c"]
> == ["a" "b" "c"]
>>> code: [print member]
> == [print member]
>>> foreach member block code
> a
> b
> c
>>>
> It seems to do directly what you intend and is simpler too.
> Andrew Martin
> ICQ: 26227169
> http://members.xoom.com/AndrewMartin/
->><-
--
Fantam