[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: symbol-macrolet
- To: Gregor.pa@XEROX.COM
- Subject: Re: symbol-macrolet
- From: kanderso@WILMA.BBN.COM
- Date: Fri, 20 Nov 87 06:37:20 -0500
- Cc: common-lisp-object-system@SAIL.STANFORD.EDU
- In-reply-to: Your message of Thu, 19 Nov 87 17:13:00 -0800. <871119171306.3.GREGOR@SPIFF.isl.parc.xerox.com>
I think there was an obvious bug in your example. How about:
(defmacro ^2 (form &optional environment)
(if (and (symbolp form)
(eq (macroexpand-1 form environment) form) ; <-
`(* ,form ,form)
`(expt ,form 2)))
I tried to come up with another example. This is more generic
(dispatching on whether the form is a symbol or not) but it seems
more lame.
(defun dispatch (form &optional environment)
(if (symbolp form)
(setq form (macroexpand-1 form environment)))
(if (and (symbolp form)
(special-symbol form))
(dispatch-special-symbol form environment)
(dispatch-form form envrionment)))
k