[REBOL] Re: Composing lists in lists
From: volker:nitsch:gma:il at: 9-Mar-2006 4:59
Also look for 'append and friends, series-function.
Rebol is not pure functional, it happily changes its variables.
So blocks (rebols "lists") are usually build by appending values to it,
not by composing new blocks.
Means you would 'compose the code for a button,
but 'append a lot of buttons to a layout.
On 3/9/06, Jeff Massung <massung-gmail.com> wrote:
> I am a happy man. Thank you. And, I don't know how I missed that. Thanks
> again!
>
> Jeff M.
>
> On 3/8/06, Tom Conlin <tomc-cs.uoregon.edu> wrote:
> >
> >
> > 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
> >
> > --
> > To unsubscribe from the list, just send an email to
> > lists at rebol.com with unsubscribe as the subject.
> >
> >
>
> --
> massung-gmail.com
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
-Volker
Any problem in computer science can be solved with another layer of
indirection. But that usually will create another problem.
David
Wheeler