QUOTEd forms don't contribute an additional printing level when pretty-printing

Bug #768684 reported by Jean-Philippe Paradis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Low
Unassigned

Bug Description

[Edit: Actually, after more testing, I seem to understand that the real problem is that QUOTEd forms don't contribute an additional printing level. Providing a much better test-case...]

What I do:
(dotimes (level 3)
  (format t "~D: " level)
  (write ''''(''('hello)) :level level :pretty t)
  (terpri))

What happens:
Output:
0: '''#
1: '''(''#)
2: '''(''('HELLO))

What I expected to happen:
Output:
0: #
1: '#
2: ''#

Note that the following behaves correctly, so this is really a pretty-printer problem:
(dotimes (level 3)
  (format t "~D: " level)
  (write ''''(''('hello)) :level level :pretty nil)
  (terpri))
Output:
0: #
1: (QUOTE #)
2: (QUOTE (QUOTE #))

SBCL version: 1.0.42
uname -a: Linux dynamorph 2.6.32-30-generic #59-Ubuntu SMP Tue Mar 1 21:30:21 UTC 2011 i686 GNU/Linux

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF-UNIX :ASDF2 :ASDF :ANSI-CL
 :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
 :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX
 :SB-THREAD :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :C-STACK-IS-CONTROL-STACK :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
 :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :LINKAGE-TABLE
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T)

description: updated
summary: - The pretty-printer unconditionally prints the quote character of QUOTEd
- forms regardless of *print-level*
+ QUOTEd forms don't contribute an additional printing level when pretty-
+ printing
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

It's not obvious to me that this isn't intentional or desirable -- but its not obvious that this is allowed either.

Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.