From: Kalle Olavi Niemitalo
Subject: Re: Pretty printing
Date: 
Message-ID: <873cp22d4d.fsf@Astalo.y2000.kon.iki.fi>
Edi Weitz <···@agharta.de> writes:

>   (defun foo (item list)
>     (format t "~&~A: ~<···@···@_~A~}~:>" item list))

Thank you for this example.  I've been intending to learn FORMAT
and the pretty printer myself, and parsing your format string was
rather educational.

What do you think of this variation:

  (defun foo (item list)
    (format t "~&~A: ~<·@·······@_~}~:>" item list))

For some reason, I got "FUNCALL: the function NIL is undefined"
when I tried these in Debian CLISP 2.30-4.  CMUCL is OK, though.

> BTW, can anybody actually memorize all these crazy FORMAT directives?

The effect of the at-sign in ··@<...~:>" and ··@{...~}" seems
similar to what it does in `(,@...).  Or is it the opposite? ;-)

Perl has a nice list of mnemonics for its punctuation variables.

From: Edi Weitz
Subject: Re: Pretty printing
Date: 
Message-ID: <87fzt1raw6.fsf@bird.agharta.de>
Kalle Olavi Niemitalo <···@iki.fi> writes:

> Edi Weitz <···@agharta.de> writes:
> 
> >   (defun foo (item list)
> >     (format t "~&~A: ~<···@···@_~A~}~:>" item list))
> 
> Thank you for this example.  I've been intending to learn FORMAT and
> the pretty printer myself, and parsing your format string was rather
> educational.
> 
> What do you think of this variation:
> 
>   (defun foo (item list)
>     (format t "~&~A: ~<·@·······@_~}~:>" item list))
> 
> For some reason, I got "FUNCALL: the function NIL is undefined" when
> I tried these in Debian CLISP 2.30-4.  CMUCL is OK, though.

CLISP's is buggy as far as support for FORMAT and pretty printing is
concerned as I just learned from the CLISP mailing list. (Or to put it
more mildly: Nobody bothered to implement the full pretty printing
machinery yet.)

In particular, a quick glance at the source code seems to reveal that
CLISP doesn't implement ~< as in 22.3.5.2 but only as in 22.3.6.2 -
that's probably why your FOO works with CLISP and mine doesn't.

Cheers,
Edi.
From: Kalle Olavi Niemitalo
Subject: Re: Pretty printing
Date: 
Message-ID: <87r8cladj8.fsf@Astalo.y2000.kon.iki.fi>
Edi Weitz <···@agharta.de> writes:

> that's probably why your FOO works with CLISP

Does it?  It didn't when I tried.