From b90dcfab16de6a26c039a1ad3052e92c85317e11 Mon Sep 17 00:00:00 2001 From: Nick Maher Date: Mon, 20 Feb 2023 23:40:04 +1100 Subject: [PATCH] Fixed extra newlines on clisp. When calling princ on clisp with a string that contains embedded newlines, it seems to print an extra newline before printing the string. --- op.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/op.lisp b/op.lisp index 152eb7a..de0ee7f 100644 --- a/op.lisp +++ b/op.lisp @@ -133,7 +133,8 @@ (write-var var (1- (read-signed-var var)))) (def-op (:1op #x07 "print-addr") (addr) - (princ (decode-text addr))) + (let ((s (decode-text addr))) + (write-sequence s *standard-output*))) (def-op (:1op #x09 "remove-obj") (obj) (obj-remove obj)) @@ -148,7 +149,8 @@ (incf *pc* (- (u16->s16 offset) 2))) (def-op (:1op #x0d "print-paddr") (addr) - (princ (decode-text (* addr 2)))) + (let ((s (decode-text (* addr 2)))) + (write-sequence s *standard-output*))) (def-op (:1op #x0e "load" :store t) (var) (when (zerop var) @@ -170,7 +172,7 @@ (def-op (:0op #x02 "print") () (multiple-value-bind (s byte-len) (decode-text *pc*) - (princ s) + (write-sequence s *standard-output*) (incf *pc* byte-len))) (def-op (:0op #x03 "print-ret") ()