From: Jon Reid
Subject: Want macro to produce 3 function calls
Date: 
Message-ID: <Bs1zz1.E89@news.cso.uiuc.edu>
OK, this LISP beginner needs more help.  Here's what I'm trying to do:

There are 3 functions I call whose parameters are closely related.  I'm
trying to write a single macro to produce the 3 function calls.

How can I do this?  Every macro I've seen evaluates to *one* list.

-- Jon Reid  (······@uiuc.edu)

From: David A. Duff
Subject: Re: Want macro to produce 3 function calls
Date: 
Message-ID: <duff.712254841@starbase>
In <··········@news.cso.uiuc.edu> ········@uxa.cso.uiuc.edu (Jon Reid) writes:

>OK, this LISP beginner needs more help.  Here's what I'm trying to do:

>There are 3 functions I call whose parameters are closely related.  I'm
>trying to write a single macro to produce the 3 function calls.

>How can I do this?  Every macro I've seen evaluates to *one* list.

(defmacro foo (x y z)
  `(progn (fun-1 ,x)(fun-2 ,y)(fun-3 ,z)))

dave duff               mitre corporation           703-883-7731
····@mitre.org         ai technical center        mclean, va usa
From: R. Whitney Winston
Subject: Re: Want macro to produce 3 function calls
Date: 
Message-ID: <1992Jul27.180128.22493@athena.mit.edu>
In article <··········@news.cso.uiuc.edu>, ········@uxa.cso.uiuc.edu (Jon Reid) writes:
|> OK, this LISP beginner needs more help.  Here's what I'm trying to do:
|> 
|> There are 3 functions I call whose parameters are closely related.  I'm
|> trying to write a single macro to produce the 3 function calls.
|> 
|> How can I do this?  Every macro I've seen evaluates to *one* list.
|> 
|> -- Jon Reid  (······@uiuc.edu)

You're right, a macro is expanded to one list and then it is eval'd.
You can make 3 function calls as follows:

(defmacro three-calls (one two three)
	`(progn (print ,one)
		(print ,two)
		,three))

>(three-calls '1 '2 '3)
1
2
3
>

---------
>>whitney
<········@athena.mit.edu>
<········@speckle.ncsl.nist.gov>
From: Jon Reid
Subject: Re: Want macro to produce 3 function calls
Date: 
Message-ID: <Bs29pG.Isw@news.cso.uiuc.edu>
Thanks to everyone who responded.  It seems "progn" is the way to go.

Jon