From: Sam S. <sd...@gn...> - 2008-03-18 14:21:52
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 do...@hc... wrote: | | I just encountered some surprising behaviour with clisp 2.41 | (on IRC they say they get the same behaviour with 2.44): | | [1]> (defconstant crlf #.(format nil "~C~C" #\Return #\Linefeed)) | CRLF | [2]> (length crlf) | 2 | [3]> (length (format nil "Q~a" crlf)) | 4 | | I was expecting that to be 3, not 4. It looks like an extra linefeed | is being added by format for some reason. yeah, this does not seem right, nevertheless, it is :-) you are pretty-printing two objects: #\Q (a one-liner) and CRLF (a multi-liner). we believe that "pretty", in this case, means each object on its own line. http://clisp.cons.org/impnotes/faq.html#faq-pp-newline http://clisp.cons.org/impnotes/faq.html#faq-fine if you want CR/LF-terminated lines, read up http://clisp.cons.org/impnotes/stream-dict.html#extfmt http://clisp.cons.org/impnotes/encoding.html#newline http://clisp.cons.org/impnotes/clhs-newline.html | Thanks for a great product, you are welcome! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH38/rPp1Qsf2qnMcRAuNcAKCxak6FYCdyblQCyD6+8QuSksHx7QCeOZop 3r5rbDV+DOOxZ+qM789LByo= =VUm/ -----END PGP SIGNATURE----- |