From: AGENT DAN
Subject: Defun Parameter &rest
Date: 
Message-ID: <1992Mar27.050010.11257@umbc3.umbc.edu>
Hi! I'm trying to implement a function to use the '&rest' parameter.

Part of the function looks like this

(defun my_mapcar (func_name list1 &rest list2)
    .....
    .....
    .....
        (my_mapcar func_name (cdr list1) (??? list2)
)


what i want to do is resend the 'list2 as the individual parameters
again rather than a list of parameters.

list2 currently looks like this  ( (2 5) (1 8) )
  - a list of lists, with some equal length values inside

I want to resend the list2 as  (2 5) (1 8)   as new parameters
and there can be any number of paramaters, not just 2 as i had
shown.

Thanks
Dan



-- 
Agent DCM                |  Dept. of Computer Science   !!
·······@umbc5.umbc.edu   |  UMBC, Baltimore, MD 21228  \__/
From: Michael Greenwald
Subject: Re: Defun Parameter &rest
Date: 
Message-ID: <michaelg.701709230@Xenon.Stanford.EDU>
·······@umbc5.umbc.edu (AGENT DAN) writes:

>(defun my_mapcar (func_name list1 &rest list2)
>    .....
>        (my_mapcar func_name (cdr list1) (??? list2)
>)

>what i want to do is resend the 'list2 as the individual parameters
>again rather than a list of parameters.

Use APPLY, as in (APPLY #'MY_MAPCAR FUNC_NAME (CDR LIST1) LIST2)

I'm not sure this is what you >really< want, but it is what you asked for.