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
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)
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
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
--=-=-=
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-----
--=-=-=--