Subject: pretty printer and format

From: [email-masked]
Date: Wed, 27 Apr 1994 10:53:37 +0100

Hello everybody,

there's a difference in the behavior of the pretty printer using format
in VAX Lisp and CLisp (see below). If it is implementation-dependent, 
how to make CLisp doing the same ?

(DEFUN print-something ()

 (LET ( (*PRINT-PRETTY* T)
        (something-to-print (MAKE-ARRAY '(3 20) :INITIAL-ELEMENT 0)) )

      (FORMAT T "That's it: ~A" something-to-print) ) )

Using VAX LISP V3.1 this gives what i want:

That's it: #2A((0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 
               (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
               (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))

In CLisp it comes with

That's it: 
#2A((0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 
    (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
    (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
   )

What's wrong with this picture ?

By the way, is it possible to use colnum in ~colnumT for example
in a variable way. I'm solving it by constructing the format string
before using FORMAT:

(DEFUN string-add (&REST args)

 (SETQ args (REMOVE NIL args))
 (IF (NULL args)
     ""
     (FORMAT NIL "~{~A~}" args) ) )

;---

(LET* ( (tab (get-a-number-from-somewhere))
        (f-string (string-add "~A~" tab "T~A")) )

      (FORMAT T f-string a b) )

Is there another way ?

Thanks in advance
Nummi

===================================================

     _/_/_/_/   _/    Ralf Numrich
    _/         _/    [email-masked]
   _/         _/    Geodaetisches Institut
  _/  _/_/   _/    RWTH Aachen
 _/    _/   _/    Templergraben 55
_/_/_/_/   _/    52062 Aachen +49 241  805292
                          FAX +49 241 8888124

---

From: haible (Bruno Haible)
Date: Wed, 27 Apr 94 13:43:56 +0200

Ralf Numrich <[email-masked]> states:

> in VAX Lisp and CLisp (see below).

This is implementation dependent. CLISP prefers to output more newlines
and less spaces.

> in a variable way.

Yes. Try something like (FORMAT T "~A~VT~A" "He" 6 "llo"). See CLtL2 p. 582.

                    Bruno Haible
                    [email-masked]