home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.lisp
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!micro-heart-of-gold.mit.edu!bloom-beacon!bloom-picayune.mit.edu!athena.mit.edu!wwinston
- From: wwinston@athena.mit.edu (R. Whitney Winston)
- Subject: Re: Want macro to produce 3 function calls
- Message-ID: <1992Jul27.180128.22493@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: e40-008-13.mit.edu
- Organization: Massachusetts Institute of Technology
- References: <Bs1zz1.E89@news.cso.uiuc.edu>
- Date: Mon, 27 Jul 1992 18:01:28 GMT
- Lines: 28
-
- In article <Bs1zz1.E89@news.cso.uiuc.edu>, jmrg9881@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 (j-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
- <wwinston@athena.mit.edu>
- <wwinston@speckle.ncsl.nist.gov>
-