[REBOL] Re: Composing lists in lists
From: tomc:cs:uoregon at: 8-Mar-2006 17:29
Hi Jeff
? is also your friend.
>> ? compose
USAGE:
COMPOSE value /deep /only
DESCRIPTION:
Evaluates a block of expressions, only evaluating parens, and returns a block
.
COMPOSE is a native value.
ARGUMENTS:
value -- Block to compose (Type: any)
REFINEMENTS:
/deep -- Compose nested blocks
/only -- Inserts a block value as a block
>> list: [a b c]
== [a b c]
>> compose/only [ 1 2 (list) 3]
== [1 2 [a b c] 3]
>>
Jeff Massung wrote:
> Another question, folks (I'll be full of them for a bit). And, I appreciate
> the quick answers I've been getting from everyone :-)
>
> How do I compose a list in a list? For example:
>
>>> list: [a b c]
> == [a b c]
>
>>> compose [ 1 (list) ]
> == [1 a b c]
>
> So, I would actually like it to be: [1 [a b c]]. Now, I can force this by
> doing something like:
>
>>> list: [ [a b c] ]
>>> compose [ 1 (list) ]
> == [1 [a b c]]
>
> But this not only sure feels like voodoo-hackery, but just wrong. I'm sorry
> if this is a trivial question and the answer is in the REBOL dictionary, but
> looking through all the series functions, compose was the closest I got to
> what I was looking for.
>
> Jeff M.
>
> --
> massung-gmail.com
>
--
... nice weather eh tomc-cs.uoregon.edu