X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fprint.lisp;h=02f3919ecb820bf18734d1063a7c8fdc8ce92c6d;hb=71497337d7fc99cf8eefe239e662f86c67519d57;hp=48af786e0b52972902a752909d871e00c304a4ea;hpb=b9e78f806d34dbf2a3b9dc3eb9c3959a30513ef1;p=jscl.git diff --git a/src/print.lisp b/src/print.lisp index 48af786..02f3919 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -16,6 +16,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with JSCL. If not, see . +(/debug "loading print.lisp!") + ;;; Printer (defun lisp-escape-string (string) @@ -43,6 +45,7 @@ (when (or (terminalp ch) (char= ch #\:) (char= ch #\\) + (not (char= ch (char-upcase ch))) (char= ch #\|)) (return-from escape-symbol-name-p t)))) dots-only)) @@ -254,14 +257,19 @@ (let ((*print-escape* nil)) (write-to-string form))) +(defun terpri () + (write-char #\newline) + (values)) + (defun write-line (x) (write-string x) - (write-string *newline*) + (terpri) x) -(defun warn (string) +(defun warn (fmt &rest args) (write-string "WARNING: ") - (write-line string)) + (apply #'format t fmt args) + (terpri)) (defun print (x) (write-line (prin1-to-string x)) @@ -280,7 +288,7 @@ ((char= next #\~) (concatf res "~")) ((char= next #\%) - (concatf res *newline*)) + (concatf res (string #\newline))) ((char= next #\*) (pop arguments)) (t @@ -297,4 +305,8 @@ (defun format-special (chr arg) (case (char-upcase chr) (#\S (prin1-to-string arg)) - (#\A (princ-to-string arg)))) + (#\A (princ-to-string arg)) + (#\D (princ-to-string arg)) + (t + (warn "~S is not implemented yet, using ~~S instead" chr) + (prin1-to-string arg))))