[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Staus of proposals 10, 11, and 12
Date: 29 Jul 1986 21:47-EDT
From: NGALL@G.BBN.COM
Date: Tue, 29 Jul 86 11:50 EDT
From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>
I may have thought of one usage:
(macrolet ((print-them (list)
`(mapc #'print ,list)))
(declare (notinline mapc))
...)
If anybody else believes this, perhaps it should be one of the examples?
I don't believe it. The stuff inside the backquoted list is not code,
it is data. Here's a similar one that I believe:
(macrolet ((print-them (list)
`(progn ,@(mapcar #'(lambda (item) `(print ',item))
list)))
(declare (notinline mapcar))
...)
In this, the mapcar funcall form IS code.
You misunderstand. Declarations have a scoping for code that it sees.
My intention was that anybody who calls (print-them some-list) expands into
(mapc #'print some-list)
and that the declaration forces MAPC to be open coded. Your definition
has two differences from mine: (1) Your declaration tries to affect the
expansion PROCESS (mine affects the processing of the expansion), and
(2) your contract is different than mine (mine takes a runtime list,
your's takes a compile time list). To get (1), I claim your declaration
is in the wrong place. It should have been
(macrolet ((print-them (list)
(declare (notinline mapcar))
`(progn ,@(mapcar #'(lambda (item) `(print ',item))
list))))
...)
Note that this still is not
a strong argument for decls in the body of a macrolet, since the decl
could have been put in the body of the print-them macro definition.
"must" not "could"
But I agree that we should allow decls in the body of a macrolet.