jose napsal(a):
> I agree, using collect 'emit is more intuitive.
>
> The parallel with set/get is important too. I want to
> be able to do this
>
> collect to-word join "block-" name-var ...
> so that in a complex loop the different result blocks
> are named dynamically.
>
> Is this possible to do if the argument is not a
> lit-word (as per Ladislav email I thought it wouldn't
> be possible) ?
>
The expression
collect to-word join ...
certainly is possible if the referentially transparent argument passing
is picked, i.e. in case the COLLECT function is declared as follows:
collect: closure [
{Collects values, returning them as a series.}
[throw]
emit [word!] "Word used to collect values"
...
*but* there is a little misunderstanding here. The argument is not the
name of the result block, but rather the name of the EMIT function used.
If I want to name the result, I can do:
my-block: collect 'emit [...]
or
set to-word join "block-" name-var collect 'emit [...]
etc.
Hope it clears the situation a bit.
-L
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.