[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Robert S. Boyer <boyer@CLI.COM>: Backquote Documentation Elaboration]

I think this falls into the "editorial" category. 

     ----- Begin Forwarded Messages -----

Return-Path: <boyer@CLI.COM>
Received: from CLI.COM ([]) by Xerox.COM ; 21 JAN 89 09:17:00 PST
Received: by CLI.COM (4.0/1); Sat, 21 Jan 89 11:12:14 CST
Date: Sat, 21 Jan 89 11:12:14 CST
 From: Robert S. Boyer <boyer@CLI.COM>
Message-Id: <8901211712.AA17553@CLI.COM>
To: masinter.pa
Subject: Backquote Documentation Elaboration
Reply-To: boyer@cli.com

On p. 349 of CLTL it states "An implementation is quite free to
interpret backquote in any way such that a backquoted form, when
evaluated, will produce a result equal to that produced by the
interpretation shown here."  It should perhaps be emphasized that the
phrase ``when evaluated'' means ``when evaluated in the implementation
of Common Lisp that is currently running'' rather than ``when
evaluated in any correct implementation of Common Lisp''.  The
following examples on p. 350 and 351 illustrate alternative results of
backquote reading that use standard Common Lisp functions such as
APPEND, LIST*, etc., but none that use things from, say, package

Here is a function that illustrates READ treating backquote
differently in the three Common Lisps I have at hand, using in two
cases functions not defined in CLTL.

(in-package "USER")

(defun which-lisp ()
  (let* ((sym (car (read-from-string "`(foo ,y)")))
	 (package-name (package-name (symbol-package sym))))
    (cond ((eq sym 'list) 'kcl)
	  ((equal package-name "SYSTEM-INTERNALS")
	  ((equal package-name "LUCID-RUNTIME-SUPPORT")
	   ;  works in Sun/Lucid 3.0, but not in 2.1
	  (t 'unknown))))

     ----- End Forwarded Messages -----