[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
> Date: 28 May 85 14:38 PDT
> From: masinter.pa@Xerox.ARPA
> Subject: programs writing backquote
>
> In part of the discussion over nesting depth of backquote, more than one
> person alluded to the possibility that a *program* could write a 3-deep
> nested backquote and that this was generally a good thing.
>
> However, as far as I can tell, ... because there is no defined
> S-expression representation of backquotes... the only thing GSSB ( Guy
> Steele's Silver Book) defines is the surface syntax.
This is curious because in PSL the ` read-macro seems to generate a
true LISP macro (i.e. an s-expression representation of the ` syntax)
which then actually implements the semantics of the ` character when
interpreted or compiled. Perhaps CL should specify something like this
explicitly? Below are examples of original PSL source and the result
of READing into memory following by PRIN1ing it back out (then
manually prettyprinting in EMACS). It seems to me quite reasonable
that a PRINter function that is smarter than PRIN1 might re-introduce
the backquote optimizations (or in complex cases find better
optimizations than given by original programmer).
(defmacro cl-alias (sl-name cl-name)
`(defmacro ,cl-name form
`(,',sl-name . ,form)))
(DEFMACRO CL-ALIAS (SL-NAME CL-NAME)
(BACKQUOTE
(DEFMACRO (UNQUOTE CL-NAME) FORM
(BACKQUOTE ((UNQUOTE (QUOTE (UNQUOTE SL-NAME)))
UNQUOTE FORM)))))
(defmacro errset (form flag)
`(errorset `,',form ,flag ,flag))
(DEFMACRO ERRSET (FORM FLAG)
(BACKQUOTE
(ERRORSET
(BACKQUOTE (UNQUOTE (QUOTE (UNQUOTE FORM))))
(UNQUOTE FLAG)
(UNQUOTE FLAG))))