1.0.27.38: make FAILED-AVER use a list form of code
authorChristophe Rhodes <csr21@cantab.net>
Fri, 24 Apr 2009 13:27:57 +0000 (13:27 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Fri, 24 Apr 2009 13:27:57 +0000 (13:27 +0000)
Previously, we constructed a printed version of the code and used that,
but it seems remarkably hard to get identical printed contents from identical
list structure in three different implementations: indentation,
line breaks, QUOTE and FUNCTION, and so on all seem to vary.

2 previous commit messages follow:

bind printer control variables in FAILED-AVER

FAILED-AVER prints source code with ~A.  If printer control variables
are different in different implementations, then the error message will
be different.

Actually at the moment the binding (of *PRINT-PRETTY* to T) is probably
a no-op.  We tried binding *PRINT-PRETTY* to NIL to get the same output
as XCL, but apparently, other implementations (CLISP, reportedly ECL)
don't obey CLHS 22.1.3.5 for printing conses when the pretty printer is
off.

another attempt to tame AVER

binding printer control variables is all well and good, but linebreaks
cause problems.  We could probably deal with that with a suitable value
for *pprint-right-margin*, but... instead, just save the form, not its
printed representation.

src/code/early-extensions.lisp
version.lisp-expr

index 1738fbd..3d1a9b7 100644 (file)
 ;;; guts of complex systems anyway, I replaced it too.)
 (defmacro aver (expr)
   `(unless ,expr
-     (%failed-aver ,(format nil "~A" expr))))
+     (%failed-aver ',expr)))
 
-(defun %failed-aver (expr-as-string)
+(defun %failed-aver (expr)
   ;; hackish way to tell we're in a cold sbcl and output the
-  ;; message before signallign error, as it may be this is too
+  ;; message before signalling error, as it may be this is too
   ;; early in the cold init.
   (when (find-package "SB!C")
     (fresh-line)
     (write-line "failed AVER:")
-    (write-line expr-as-string)
+    (write expr)
     (terpri))
-  (bug "~@<failed AVER: ~2I~_~S~:>" expr-as-string))
+  (bug "~@<failed AVER: ~2I~_~A~:>" expr))
 
 (defun bug (format-control &rest format-arguments)
   (error 'bug
index e63ce82..820ed83 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.27.37"
+"1.0.27.38"