Subject: [clisp-list] FORMAT pretty printing directives

From: Edi Weitz <[email-masked]>
Date: Wed Dec 11 17:42:05 2002

In CLISP 2.30 (freshly checked out from CVS):

  [1]> (defun foo (item list)
    (format t "~&~A: ~<~^~A~@{~:@_~A~}~:>" item list))
  FOO
  [2]> (foo 'bar (list 3 (make-hash-table) "frob"))
  BAR: (3 #S(HASH-TABLE EQL) frob)
  NIL

I expected this to look like, say, in CMUCL,

  * (foo 'bar (list 3 (make-hash-table) "frob"))

  BAR: 3
       #<EQL hash table, 0 entries {48D13B95}>
       frob
  NIL

i.e. I didn't expect the enclosing parentheses (according to CLHS
22.3.5.2: "If the enclosed portion consists of only a single segment,
both the prefix and the suffix default to the null string. If the
colon modifier is used (i.e., ~:<...~:>), the prefix and suffix
default to "(" and ")" (respectively) instead of the null string.")
and I expected the list elements to be on separate lines and aligned
(according to CLHS 22.3.5.1: "~:@_ is the same as (pprint-newline
:mandatory).").

Are these bugs or am I missing something about how pretty printing is
supposed to work (maybe some special variable that has different
default settings in CLISP than in CMUCL)?

BTW, I just realized that this behaviour may also be explained by
CLISP interpreting LIST as one single item instead of consuming each
element in turn but that still wouldn't meet my expectations.

Thanks,
Edi.

---

From: Sam Steingold <[email-masked]>
Date: Wed Dec 11 18:33:03 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] FORMAT pretty printing directives"
> * Sent on 12 Dec 2002 02:40:51 +0100
> * Honorable Edi Weitz <[email-masked]> writes:
>

format / pprint in known to be "incomplete" (buggy).
would you like to work on this?

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Never succeed from the first try - if you do, nobody will think it was hard.

---

From: Edi Weitz <[email-masked]>
Date: Thu Dec 12 03:08:09 2002

> would you like to work on this?

Hmm, the question isn't really whether I would _like_ to do it but
whether I _can_ do it. I wouldn't consider myself to be a proficient
Lisp coder and I have no idea whatsoever about the CLISP internals.

Apart from that it's always a matter of finding the spare time and
having different priorities. I mainly work with CMUCL and LispWorks
and usually only invoke CLISP and other CL implementations to make
sure my programs are portable.

Cheers,
Edi.