From 6fc7d9db187e254b4963c9d7c3b3d0c001984212 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 24 Apr 2009 13:27:57 +0000 Subject: [PATCH] 1.0.27.38: make FAILED-AVER use a list form of code 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 | 10 +++++----- version.lisp-expr | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/code/early-extensions.lisp b/src/code/early-extensions.lisp index 1738fbd..3d1a9b7 100644 --- a/src/code/early-extensions.lisp +++ b/src/code/early-extensions.lisp @@ -878,18 +878,18 @@ ;;; 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 "~@" expr-as-string)) + (bug "~@" expr)) (defun bug (format-control &rest format-arguments) (error 'bug diff --git a/version.lisp-expr b/version.lisp-expr index e63ce82..820ed83 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4