From: FranK Thiry
Subject: Very easy !
Date: 
Message-ID: <3ADFEFB8.842D55FE@emi.u-bordeaux.fr>
a function foo whith this consequence :

(foo '(1 2 3 4))
-> 1 2 3 4

in reality, i want the element of my list as parameters of a call to a
new fonction :
(foo2 (foo '(1 3 4))) == (foo2 1 3 4)

Thanks !

--
----------------------------------
           Frank Thiry
      ·····@emi.u-bordeaux.fr
----------------------------------

From: Marco Antoniotti
Subject: Re: Very easy !
Date: 
Message-ID: <y6ck84fvgbu.fsf@octagon.mrl.nyu.edu>
FranK Thiry <·····@emi.u-bordeaux.fr> writes:

> a function foo whith this consequence :
> 
> (foo '(1 2 3 4))
> -> 1 2 3 4
> 
> in reality, i want the element of my list as parameters of a call to a
> new fonction :
> (foo2 (foo '(1 3 4))) == (foo2 1 3 4)
> 
> Thanks !

Why do you want this?

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group	tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA			http://bioinformatics.cat.nyu.edu
	       "Hello New York! We'll do what we can!"
			Bill Murray in `Ghostbusters'.
From: Frode Vatvedt Fjeld
Subject: Re: Very easy !
Date: 
Message-ID: <2hr8ynykat.fsf@dslab7.cs.uit.no>
FranK Thiry <·····@emi.u-bordeaux.fr> writes:

> in reality, i want the element of my list as parameters of a call to a
> new fonction :
> (foo2 (foo '(1 3 4))) == (foo2 1 3 4)

Perhaps like this?

  (defun foo () (values 1 2 3 4))
  (defun bar (&rest args) (list* 'x args))

  (multiple-value-call #'bar 0 (foo) 5)
  => (X 0 1 2 3 4 5)


If you already have a list and need to make it into multiple-values:

  (apply #'values '(1 2 3 4))
  => 1 2 3 4

Or if you have a list and don't want to make it into multiple-values,
the function APPLY is kind of the list equivalent to MULTIPLE-VALUE-CALL:

  (apply #'bar 0 '(1 2 3 4))
  => (X 0 1 2 3 4)

-- 
Frode Vatvedt Fjeld
From: Kent M Pitman
Subject: Re: Very easy !
Date: 
Message-ID: <sfwvgnz7jol.fsf@world.std.com>
[Fundamental certainly.  Easy depends on how hard you work to confuse 
 yourself before getting someone to dig you out.]

FranK Thiry <·····@emi.u-bordeaux.fr> writes:

> a function foo whith this consequence :
> 
> (foo '(1 2 3 4))
> -> 1 2 3 4
> 
> in reality, i want the element of my list as parameters of a call to a
> new fonction :
> (foo2 (foo '(1 3 4))) == (foo2 1 3 4)

There is some problem with notation here in what you've sent that makes
it unclear what you want.  To take a list and output the elements with
spaces after each and a terminating newline, you might try:

 (defun foo (list)
   (format t "~{~A ~}~%" list))

or

 (defun foo (list)
   (dolist (element list)
     (princ element)
     (write-char #\Space))
   (terpri))

On the other hand, your example shows a "->" in it, as if you expected 
these to be return values.  In Lisp, return values are very different than
I/O.  Functions do not pipe data between them.   So if you want the
function FOO  to return data that a function FOO2 will use, you should just
do

 (defun foo (x) x)

That is, FOO should just return its argument.  And, frankly, you shouldn't
even use FOO.  But I'm trying to stick to the framework of your query.

Now, if you want the parameters of a call to be the results of another,
you want to use apply.  That is, not
 (foo2 (foo ...))
but
 (apply #'foo2 (foo ...))

So if you've done 
 (defun foo (x) x)
as I've suggested, then
 (foo2 (foo '(1 2 3 4)))
will be the same as
 (foo2 1 2 3 4)
Then again, so will
 (apply #'foo2 '(1 2 3 4))
since FOO here is nothing but an identity function.

[Side note: You must use #'FOO2 instead of FOO2 (case doesn't matter,
but having a prefixed #' does matter) whenever you use FOO2 in a
position that is not the first element of a normal function call if
you want to access FOO2's function cell isntead of its variable value.
Note that
 (apply foo2 '(1 2 3 4))
would refer to a variable named FOO2, not the function named FOO2.]