From: Christophe R. <cs...@ca...> - 2004-07-01 07:31:52
|
Liam Healy <ln...@he...> writes: > Strings get garbled up in princ: > > Looks like maybe the last (or only) line doesn't get flushed until > the next princ, or until you quit sbcl? Right. The reason you see garbling is that you're effectively printing to two different streams here: T as a stream designator means *terminal-io*, which is buffered; the repl prints return values to *standard-output*, which is also buffered; to you they look the same, though, because they're both going to your terminal. If you need to ensure that all output is flushed at any point on a given stream, use the Common Lisp functions FORCE-OUTPUT or FINISH-OUTPUT. Cheers, Christophe -- http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757 (set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b))) (defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge) |