[Openmcl-devel] Printing space symbol

Waldek Hebisch hebisch at math.uni.wroc.pl
Fri Jul 25 14:18:41 PDT 2008


Hello all,

I am one of developers of computer algebra system called FriCAS
(for more information see http://fricas.sf.net).  Currently
FriCAS works rathe well on top of Closure CL.  However, there
are some problems, one of them below.

I need to print readably symbol with print name consisting of
a single space.  However, it seems that Closure CL sometimes
incorrectly prints such symbols.  More, precisly, when such
symbol is at the end of line then only backlash is printed
(space char is lost) -- which means that space turns into
a newline.

The last version I tried is 'clozurecl-1.2-rc1-linuxx8664.tar.gz'
but the problem was present also in earlier snapshots.

The following code exibits the problem:

(with-open-file (fil "out" :direction :output
                           :if-does-not-exist :create
                           :if-exists :overwrite)
      (let ((*print-readably* t))
         (pprint '(|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
                    | | | | | | | | | | | | | | | | | | | | | |
 |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|) fil)))

As a workaround I use the following patch:


--- openmcl/ccl/level-1/l1-io.lisp.bb	2007-08-27 20:47:57.000000000 +0200
+++ openmcl/ccl/level-1/l1-io.lisp	2007-08-27 20:49:11.000000000 +0200
@@ -1040,6 +1040,8 @@
                         ;; or symbol consisting entirely of .'s
                         (dotimes (i len t)
                           (declare (fixnum i))
+			  (when (eql (schar name i) #\ )
+			    (return t))
                           (unless (eql (schar name i) #\.)
                             (return nil))))
                 (return-from alice

-- 
                              Waldek Hebisch
hebisch at math.uni.wroc.pl 



More information about the Openmcl-devel mailing list