[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Macros -> declarations
- To: KMP@SCRC-STONY-BROOK.ARPA, RWK@SCRC-YUKON.ARPA, Fahlman@CMU-CS-C.ARPA
- Subject: Macros -> declarations
- From: Bernard S. Greenberg <BSG@SCRC-STONY-BROOK.ARPA>
- Date: Fri, 10 May 85 15:39 EDT
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: <850510015144.5.KMP@RIO-DE-JANEIRO.SCRC.Symbolics.COM>
Date: Fri, 10 May 85 01:51 EDT
From: Kent M Pitman <KMP@SCRC-STONY-BROOK.ARPA>
No, this is too confusing. What about things like STRING which are already functions?
Do we propose to have macro syntax available in a context where function syntax is not?
I think that would be very confusing. Also, what if someone did
(DEFMACRO TYPE (X) `(PRINT ,X))
and then someone else did (DECLARE (TYPE LIST FOO)). You wouldn't want to tell people
that the possible declaration names (which are all really good names) weren't available
to them for definition as names for macros (but -were- available to them as function
names)... would you?
Damn! Just when I was beginning to like this! How about, for a really off-the-wall suggestion,
a "macroification context", defined by each macro by the &EXPANDWHEN-CONTEXT notkeyword, and
whose default is (:EVAL :COMPILE) (choose any names you like)
(defmacro push (x y &expandwhen-context (:eval :compile)) ..etc.)
means that evaluation and compilation (the only kind valid today) are the contexts in which
this macro will be recognized. (I can see several implementation possibilities.)
This allows extension to :declaration, :functional-form (lambda macro) :lap-code and
n other non-intrusive, compatible possibilities.
(defmacro register (x &EXPANDWHEN-CONTEXT :declare) `(fixnum ,(cdr x)))