From: Vassil Nikolov
Subject: how to think of backquote
Date: 
Message-ID: <58807.vnikolov@math.acad.bg>
On Mon, 13 Apr 1998 12:59:20 -0700, 
Erik Naggum  <······@naggum.no> wrote in comp.lang.lisp:

>* Kent M Pitman
>| ... where again some might prefer to hae written instead of
>|   (list 'add (list 'quote x) (list 'quote y))
>| the more perspicuous:
>|    `(add ',x ',y)
>| But that depends on personal style and your intent to later side-effect;
>| the result of backquote is not something you may later modify.
>
>  no?  I'm aware that _quoted_ structures may be constants, but backquoted
>  lists and vectors always appeared me to be required guaranteed fresh,
>  insofar as structure was not specifically shared with `,.'.  according to
>  the definition in 2.4.6 Backquote in the standard, it does indeed appear
>  that only in the case of ,. will list structured be shared, and otherwise
>  not.  in other words, I view backquote as a list _constructor_.  is this
>  really unwarranted?


To me, the most useful way of thinking of backquote is as if
it is quote, with an extension.  I can't quote the exact place,
but I believe either CLtL[12] or the HyperSpec says that on
encountering backquote syntax, the reader produces a _form_such_
_that,_when_evaluated_, will produce a list (or vector) whose
structure follows the backquote template.  Since one is not supposed
to modify forms to be evaluated, forms produced by reading backquote
syntax shouldn't be destructively modified.  Now, as regards to
the result of evaluating a form produced by reading backquote syntax,
I don't think that that result is guaranteed fresh, though the
examples that are given in the language description produce
freshly consed lists.

As to ``,.'', this is not an instruction to the backquote reader
to produce shared structure, this is a license to use destructive
operations to produce the backquote form (to be evaluated).


Best regards,
Vassil.


Vassil Nikolov         <········@math.acad.bg>       (+359-2) 713-3813
Department of Information Research                       also 713-3818
Institute of Mathematics and Informatics        fax: (+359-2) 9713649
Acad. G. Bonchev, block 8, Sofia 1113, Bulgaria