Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#202 format/pprint-logical-block bug

open
Bruno Haible
clisp (525)
5
2004-04-16
2004-04-16
Antonio Leitao
No

Seems to me that clisp pretty printer doesn't handle
correctly the variable *print-right-margin*. Here's
the dribble:

[14]> (let ((*print-pretty* t) (*print-right-margin* 100))
(format t "~@<~{~A~^ + ~_~}~:>" '(a-long-name
an-even-longer-name a-really-really-long-name)))
A-LONG-NAME + AN-EVEN-LONGER-NAME +
A-REALLY-REALLY-LONG-NAME
NIL
[15]> (let ((*print-pretty* t) (*print-right-margin* 20))
(format t "~@<~{~A~^ + ~_~}~:>" '(a-long-name
an-even-longer-name a-really-really-long-name)))
A-LONG-NAME + AN-EVEN-LONGER-NAME +
A-REALLY-REALLY-LONG-NAME
NIL

In CMUCL, it works as (I) expected.

My clisp version is:
GNU CLISP 2.33 (2004-03-17) (built 3289145580) (memory
3290541647)
Software: GNU C 3.3.3 (Debian 20040320) ANSI C program
Features:
(ASDF MK-DEFSYSTEM COMMON-LISP-CONTROLLER SYSCALLS
CLX-ANSI-COMMON-LISP CLX REGEXP CLOS LOOP COMPILER
CLISP ANSI-CL COMMON-LISP LISP=CL INTERPRETER SOCKETS
GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI GETTEXT
UNICODE BASE-CHAR=CHARACTER PC386 UNIX)
Installation directory: /usr/lib/clisp/
User language: ENGLISH
Machine: I686 (I686) aleph.local [127.0.0.1]

Discussion

  • Sam Steingold
    Sam Steingold
    2004-04-16

    • assigned_to: sds --> haible
     
  • Sam Steingold
    Sam Steingold
    2004-04-16

    Logged In: YES
    user_id=5735

    it would be nice if you supplied the output you expected
    together with the actual output replacing spaces with
    underscores to avoid word wrap done by the browser.

     
  • Sam Steingold
    Sam Steingold
    2004-04-16

    • summary: Pretty printer bug --> format/pprint-logical-block bug
     
  • Antonio Leitao
    Antonio Leitao
    2004-09-21

    Logged In: YES
    user_id=1022580

    The expected output (with _ replacing space) is, for the
    first example:

    A-LONG-NAME_+_AN-EVEN-LONGER-NAME_+_A-REALLY-REALLY-LONG-NAME

    and for the second example:

    A-LONG-NAME_+
    __AN-EVEN-LONGER-NAME +
    __A-REALLY-REALLY-LONG-NAME

    Hope this helps.