[REBOL] Re: noob question: foreach usage
From: anton::wilddsl::net::au at: 16-Apr-2008 11:42
Hi Doug,
'x1' and 'x2' *are* values - values of type word!.
What you want are the associated values of
the words, so you need to reduce the words.
(Maybe you also want the words themselves ?
but usually we don't.)
You can reduce before passing to the function,
or afterwards, inside the function, eg:
send2: func [arglist][
?? arglist
probe reduce arglist
foreach arg reduce arglist [?? arg]
foreach arglist reduce arglist [probe arglist]
]
x1: "hello"
x2: "world"
send2 [x1 x2]
However, maybe what you want is just:
send2: func [arglist][
foreach val arglist [?? val]
]
x1: "hello"
x2: "world"
send2 reduce [x1 x2]
Anton.
DougEdmunds wrote: