[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pretty printer and format




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
    _/         _/    numrich@rwth-aachen.de
   _/         _/    Geodaetisches Institut
  _/  _/_/   _/    RWTH Aachen
 _/    _/   _/    Templergraben 55
_/_/_/_/   _/    52062 Aachen +49 241  805292
                          FAX +49 241 8888124