FORMAT/PPRINT-LOGICAL-BLOCK of CONDITIONs ignoring *PRINT-CIRCLE*
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Medium
|
Unassigned |
Bug Description
In sbcl-0.9.13.34,
(defparameter *c*
(
(setf *print-circle* t *print-level* 4)
(format nil "~@<~A~:@>" *c*)
gives
"ow... (((#)))"
where I (WHN) believe the correct result is "ow... #1=(#1#)",
like the result from (PRINC-TO-STRING *C*). The question of
what the correct result is is complicated by the hairy text in
the Hyperspec "22.3.5.2 Tilde Less-Than-Sign: Logical Block",
Other than the difference in its argument, ~@<...~:> is
exactly the same as ~<...~:> except that circularity detection
is not applied if ~@<...~:> is encountered at top level in a
format string.
But because the odd behavior happens even without the at-sign,
(format nil "~<~A~:@>" (list *c*)) ; => "ow... (((#)))"
and because something seemingly similar can happen even in
PPRINT-
(pprint-
(format *standard-output* "~A" '#1=(#1#)))
(which prints "(((#)))" to *STANDARD-OUTPUT*), I don't think
that the 22.3.5.2 trickiness is fundamental to the problem.
My guess is that the problem is related to the logic around the MODE
argument to CHECK-FOR-
enough of the intended meaning of the different MODE values to be
confident of this.
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Addenda: TRACE confuses circularity detection -- which doesn't exactly make it easier to understand what is going on.