PRINC-TO-STRING is not what we want here.
updates of CAS-able places (similar to Clojure's swap!).
* bug fix: potential for infinite recursion during compilation of CLOS slot
typechecks when dependency graph had loops. (lp#1001799)
+ * bug fix: error forms reported with some program-errors were not escaped
+ properly.
changes in sbcl-1.0.57 relative to sbcl-1.0.56:
* RANDOM enhancements and bug fixes:
(apply #'style-warn datum arguments)
(values))
+(defun source-to-string (source)
+ (write-to-string source
+ :escape t :readably nil :pretty t
+ :circle t :array nil))
+
(defun make-compiler-error-form (condition source)
`(error 'compiled-program-error
:message ,(princ-to-string condition)
- :source ,(princ-to-string source)))
+ :source ,(source-to-string source)))
;;; Fatal compiler errors. We export FATAL-COMPILER-ERROR as an
;;; interface for errors that kill the compiler dead
(with-test (:name :malformed-type-declaraions)
(compile nil '(lambda (a) (declare (type (integer 1 2 . 3) a)))))
+
+(with-test (:name :compiled-program-error-escaped-source)
+ (assert
+ (handler-case
+ (funcall (compile nil `(lambda () (lambda ("foo")))))
+ (sb-int:compiled-program-error (e)
+ (let ((source (read-from-string (sb-kernel::program-error-source e))))
+ (equal source '#'(lambda ("foo"))))))))