[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'backquote' actions
- To: Morrison at UTAH-20
- Subject: 'backquote' actions
- From: Jon L White <JONL at MIT-MC>
- Date: Tue ,12 Jan 82 18:38:00 EDT
- Cc: LISP-FORUM at MIT-MC
In MacLISP, the variable BACKQUOTE-EXPAND-WHEN determines
whether the reader-macro produces a minimal, standard, lisp form
which merely 'evaluates to the right thing', or a form with extra
evaluator macros inserted which correspond to the places where 'commas'
of various kinds appeared. Of course, the latter format 'evaluates
to the right thing' too.
The LISPM version produces a rather minimal form for evaluation, but using
internal function names rather than the standard lisp ones.
The point of having either the extra evaluator macros, or the special
internal function names, is so that a random piece of code which was
constructed up by the backquote macro can be re-parsed into a faithful
representation of the original input. The advantage of using evaluator
macros as opposed to internal subrs is that automatic code analyzers
don't have to know about these internal names (but rather would only
have to know about macroexpansion in general and the usual primitive
lisp subrs); the disadvantage of using the evaluator macro format is
that it takes an extra cons cell or so for each comma in the source input.
Note for example that there currently is no way to distinguish between the
internal forms of the following two functions:
(defun FIVE+ONE (x) '6)
(defun SIX (x) (quote 6))
whereas
(defun QUOTIFY-1 (x) `',x)
(defun QUOTIFY-2 (x) (list (quote QUOTE) x))
are distinguishable when BACKQUOTE-EXPAND-WHEN is set to EVAL (or
when other internal markers are left in).