The closing " of a string is omitted when truncation occurs due to *print-lines* in pretty-printed escaped output

Bug #768622 reported by Jean-Philippe Paradis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Won't Fix
Medium
Unassigned

Bug Description

What I do:
(progn (write (format nil "This is~%a test.") :pretty t :escape t :lines 1)
       (values))

What happens:
Output:
"This is ..

What I expected to happen:
Output:
"This is .."

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)

Revision history for this message
Jean-Philippe Paradis (hexstream) wrote :

Come to think of it, I think the output should be:
"This is.."

Is the additional space between "is" and ".." conforming and intentional?...

Changed in sbcl:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Douglas Katzman (dougk) wrote :

Two problems with this:
1. It's unclear how the pretty-printer should respond to fixed strings that contain mandatory newlines. i.e. it might not be correct to truncate in the first place.
2. It's unclear that strings have status as logical blocks. I see no implication in the spec that they do.
I tested the example in ABCL, ECL, Allegro, and LispWorks.
Half of them don't truncate (taking viewpoint 1), and half truncate but don't print a trailing quote (taking viewpoint 2).

Changed in sbcl:
status: Triaged → Won't Fix
Revision history for this message
Jean-Philippe Paradis (hexstream) wrote : Re: [Bug 768622] Re: The closing " of a string is omitted when truncation occurs due to *print-lines* in pretty-printed escaped output

Thank you, I think this is the first non-insane WONTFIX I have ever
received, although I don't want to take the time to audit the others
to verify if this is indeed the case.

On Sat, Dec 12, 2020 at 3:04 PM Douglas Katzman
<email address hidden> wrote:
>
> Two problems with this:
> 1. It's unclear how the pretty-printer should respond to fixed strings that contain mandatory newlines. i.e. it might not be correct to truncate in the first place.
> 2. It's unclear that strings have status as logical blocks. I see no implication in the spec that they do.
> I tested the example in ABCL, ECL, Allegro, and LispWorks.
> Half of them don't truncate (taking viewpoint 1), and half truncate but don't print a trailing quote (taking viewpoint 2).
>
>
> ** Changed in: sbcl
> Status: Triaged => Won't Fix
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/768622
>
> Title:
> The closing " of a string is omitted when truncation occurs due to
> *print-lines* in pretty-printed escaped output
>
> Status in SBCL:
> Won't Fix
>
> Bug description:
> What I do:
> (progn (write (format nil "This is~%a test.") :pretty t :escape t :lines 1)
> (values))
>
> What happens:
> Output:
> "This is ..
>
> What I expected to happen:
> Output:
> "This is .."
>
> 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)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sbcl/+bug/768622/+subscriptions

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.