GNU bug report logs - #17657
pretty-print #:width values above 49 don't work?

Previous Next

Package: guile;

Reported by: Mark Polesky <markpolesky <at> yahoo.com>

Date: Sat, 31 May 2014 18:34:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17657 in the body.
You can then email your comments to 17657 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#17657; Package guile. (Sat, 31 May 2014 18:34:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark Polesky <markpolesky <at> yahoo.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 31 May 2014 18:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark Polesky <markpolesky <at> yahoo.com>
To: bug-guile <at> gnu.org
Subject: pretty-print #:width values above 49 don't work?
Date: Sat, 31 May 2014 11:24:12 -0700 (PDT)
Hi,

Neither example below should be line-wrapped, but the second one 
is.  It looks like pretty-print #:width values above 49 don't
work.  Is there a workaround?


(pretty-print
  '(234 . "901234567890123456789012345678901234567")
  #:width 49) 
=>
(234 . "901234567890123456789012345678901234567")

(pretty-print
  '(234 . "9012345678901234567890123456789012345678")
  #:width 50) 
=>
(234
 .
 "9012345678901234567890123456789012345678")


$ ./config.guess
x86_64-unknown-linux-gnu

$ guile --version
Guile 1.8.8


Thanks!
- Mark




Information forwarded to bug-guile <at> gnu.org:
bug#17657; Package guile. (Sun, 01 Jun 2014 18:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 17657 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Mark Polesky <markpolesky <at> yahoo.com>
Cc: 17657 <at> debbugs.gnu.org
Subject: Re: bug#17657: pretty-print #:width values above 49 don't work?
Date: Sun, 01 Jun 2014 14:40:56 -0400
Mark Polesky <markpolesky <at> yahoo.com> writes:
> Neither example below should be line-wrapped, but the second one 
> is.

Our pretty printer, inherited from SLIB and originally written by Marc
Feeley, uses a great many heuristics to make formatting decisions.
These heuristics are undocumented and subject to change.

One of its heuristics is that individual expressions shall not be more
than 49 columns wide.  Notice that pretty-print.scm includes the
following internal definition:

  (define max-expr-width 50)

(although in fact the maximum width ends up being 49)

> Is there a workaround?

A couple of years ago I added an undocumented #:max-expr-width keyword
argument to pretty-print, in order to improve the formatting of
psyntax-pp.scm.  You could use that.

It would be good to redesign and rewrite our pretty-printer from scratch
at some point.

> $ guile --version
> Guile 1.8.8

We no longer support Guile 1.8.x.  You should transition to 2.0.

     Thanks,
       Mark




Information forwarded to bug-guile <at> gnu.org:
bug#17657; Package guile. (Tue, 03 Jun 2014 18:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 17657 <at> debbugs.gnu.org (full text, mbox):

From: Mark Polesky <markpolesky <at> yahoo.com>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 17657 <at> debbugs.gnu.org
Subject: Re: bug#17657: pretty-print #:width values above 49 don't work?
Date: Tue, 3 Jun 2014 11:06:38 -0700 (PDT)
Mark H Weaver wrote:
> A couple of years ago I added an undocumented
> #:max-expr-width keyword argument to pretty-print, in
> order to improve the formatting of psyntax-pp.scm.  You 
> could use that.

Nice, but why leave it undocumented?  That's useful!
Anyway, I can't use it yet: my project still depends on
1.8.8, and I see that you added it in 2.0.6.

> We no longer support Guile 1.8.x.  You should transition
> to 2.0.

We are well aware, but the developers who are working on it
keep mentioning problems with curried definitions, saying
things like "stabbing around in the dark around bugs and 
undocumented areas", and that the stable version doesn't
seem so stable...  In any case, the task of transitioning to
2.0 is beyond my own expertise, so I'll just see how it
plays out.

But thank you for your explanation, advice, and quick
response.

- Mark




Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Tue, 21 Jun 2016 14:48:01 GMT) Full text and rfc822 format available.

Notification sent to Mark Polesky <markpolesky <at> yahoo.com>:
bug acknowledged by developer. (Tue, 21 Jun 2016 14:48:02 GMT) Full text and rfc822 format available.

Message #16 received at 17657-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Mark H Weaver <mhw <at> netris.org>
Cc: Mark Polesky <markpolesky <at> yahoo.com>, 17657-done <at> debbugs.gnu.org
Subject: Re: bug#17657: pretty-print #:width values above 49 don't work?
Date: Tue, 21 Jun 2016 16:47:20 +0200
Hi :)

On Sun 01 Jun 2014 20:40, Mark H Weaver <mhw <at> netris.org> writes:

> Mark Polesky <markpolesky <at> yahoo.com> writes:
>> Neither example below should be line-wrapped, but the second one 
>> is.
>
> Our pretty printer, inherited from SLIB and originally written by Marc
> Feeley, uses a great many heuristics to make formatting decisions.
> These heuristics are undocumented and subject to change.
>
> One of its heuristics is that individual expressions shall not be more
> than 49 columns wide.  Notice that pretty-print.scm includes the
> following internal definition:
>
>   (define max-expr-width 50)
>
> (although in fact the maximum width ends up being 49)
>
>> Is there a workaround?
>
> A couple of years ago I added an undocumented #:max-expr-width keyword
> argument to pretty-print, in order to improve the formatting of
> psyntax-pp.scm.  You could use that.

Just pushed some documentation, so this bug is done.

> It would be good to redesign and rewrite our pretty-printer from scratch
> at some point.

Yes!

Andy




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Jul 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.