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

Is this correct behaviour for (princ ...)


If I write a function that copies files using (princ ...) thus:

(defun read-write-char (in out)
  (with-open-file (inf in :direction :input)
    (with-open-file (outf out :direction :output :if-exists :supersede)
      (do ((next-char (read-char inf nil 'eof)
                      (read-char inf nil 'eof)))
          ((eq next-char 'eof))
        (princ next-char outf)))))

an extra blank line is inserted between each line using clisp (1997-09-22),
whereas if I use (write-char ...) instead of (princ ...) the file is copied
correctly.  Under Allegro CL, (princ ...) doesn't insert the extra lines,
and according to GLS the two functions should behave identically.  Is
princ's behaviour in clisp correct?


William Webber
William Webber        Multimedia Database Systems, RMIT, Melbourne, Australia
wew@yallara.cs.rmit.edu.au                  Food.  Shelter.  Source code.
  "'This tree is certainly good for nothing,' said Tzu Chi. 'This is why it
  has grown so large.  Ah-ha!  This is the sort of uselessness that sages
  live by.'" --- _The_Book_of_Chuang_Tzu_