From: Frank Buss
Subject: inlining lists
Date: 
Message-ID: <cefqmf$cvp$1@newsreader2.netcologne.de>
I assume the solution is very easy, but I didn't found it. I try to build a 
list like this:

(setq test (list 1 2 (multiple-value-list (floor 19 5)) 5 ))

and it produced this:

(1 2 (3 4) 5)

but I want this:

(1 2 3 4 5)

Ok, I can think of combinations with CONS or applying a flatten function to 
the result, but perhaps there is a magic char which does the right thing 
and simply "inlines" the list.

-- 
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de

From: Rainer Joswig
Subject: Re: inlining lists
Date: 
Message-ID: <joswig-8F8B71.12520631072004@individual.net>
In article <············@newsreader2.netcologne.de>,
 Frank Buss <··@frank-buss.de> wrote:

> I assume the solution is very easy, but I didn't found it. I try to build a 
> list like this:
> 
> (setq test (list 1 2 (multiple-value-list (floor 19 5)) 5 ))
> 
> and it produced this:
> 
> (1 2 (3 4) 5)
> 
> but I want this:
> 
> (1 2 3 4 5)
> 
> Ok, I can think of combinations with CONS or applying a flatten function to 
> the result, but perhaps there is a magic char which does the right thing 
> and simply "inlines" the list.

(append (list 1 2) (multiple-value-list (floor 19 5)) (list 5))

similar:

`(1 2 ,@(multiple-value-list (floor 19 5)) 5)
From: Marco Gidde
Subject: Re: inlining lists
Date: 
Message-ID: <lzekmsa1d2.fsf@tristan.br-automation.de>
Frank Buss <··@frank-buss.de> writes:

> I assume the solution is very easy, but I didn't found it. I try to build a 
> list like this:
> 
> (setq test (list 1 2 (multiple-value-list (floor 19 5)) 5 ))
> 
> and it produced this:
> 
> (1 2 (3 4) 5)
> 
> but I want this:
> 
> (1 2 3 4 5)
> 
> Ok, I can think of combinations with CONS or applying a flatten function to 
> the result, but perhaps there is a magic char which does the right thing 
> and simply "inlines" the list.

You might try this (notice the backquote):

> (setq test `(1 2 ,@(multiple-value-list (floor 19 5)) 5))
(1 2 3 4 5)


-- 
Marco
From: Frank Buss
Subject: Re: inlining lists
Date: 
Message-ID: <cefvaq$ooa$1@newsreader2.netcologne.de>
Marco Gidde <···········@tiscali.de> wrote:

> You might try this (notice the backquote):
> 
>> (setq test `(1 2 ,@(multiple-value-list (floor 19 5)) 5))
> (1 2 3 4 5)

Thanks, this works. Sorry for such newbie questions, but my copy of the 
"ANSI Common Lisp" book only next week arrives :-)

-- 
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Kalle Olavi Niemitalo
Subject: Re: inlining lists
Date: 
Message-ID: <873c373m97.fsf@Astalo.kon.iki.fi>
Frank Buss <··@frank-buss.de> writes:

> (setq test (list 1 2 (multiple-value-list (floor 19 5)) 5 ))

[...]

> but I want this:
>
> (1 2 3 4 5)

  (setq test (multiple-value-call #'list 1 2 (floor 19 5) 5))
From: Ivan Boldyrev
Subject: Re: inlining lists
Date: 
Message-ID: <svevt1xba7.ln2@ibhome.cgitftp.uiggm.nsc.ru>
--=-=-=
Content-Type: text/plain

On 8822 day of my life Frank Buss wrote:
> I assume the solution is very easy, but I didn't found it. I try to build a 
> list like this:
>
> (setq test (list 1 2 (multiple-value-list (floor 19 5)) 5 ))
>
> and it produced this:
>
> (1 2 (3 4) 5)
>
> but I want this:
>
> (1 2 3 4 5)

(setq test
    (list* 1 2
           (nconc (multiple-value-list (floor 19 5))
                  (list 5))))

-- 
Ivan Boldyrev

                                                  Your bytes are bitten.

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.6 (GNU/Linux)

iD8DBQBBDQzc4rmsj66VbhcRAtrcAJ9Ej21iwCt5fGBCJWqNdOfoJujk6gCeKDE6
2egUKcl0ScDgFg8Y7bavCAA=
=vQUz
-----END PGP SIGNATURE-----
--=-=-=--