[comp.lang.scheme] Mutation and backquote

freeman@argosy.UUCP (Jay R. Freeman) (09/26/90)

In regard to the construct `(,a b c), I thought the R3 standard
(haven't seen the later ones yet) indicates that all of what is
returned by backquote is immutable; that is, if we do

(define a 42)
(define foo `(,a b c))

making the value of foo be (42 b c), then the following are errors:

(set-car! foo 88)
(set-cdr! foo 88)
(set-car! (cdr foo) 88)
(set-cdr! (cdr foo) 88)
(set-car! (cddr foo) 88)
(set-cdr! (cddr foo) 88)

(This list doesn't go any further, because (cdddr foo) is the empty
list, which is not capable of being set-car!ed and set-cdr!ed anyway.)

If I am right, this is a somewhat stricter interpretation than in
Common Lisp.  Do people agree or disagree?


                                      -- Jay Freeman


	  <canonical disclaimer -- I speak only for myself>