X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fprint.lisp;h=a8ac834dbb42f969dd2678bd937aff63e34812c6;hb=5174d9250a918896a8505fcd18f9960a3ea634ec;hp=941b97c6a148ff52f733a7455c0df68726d87ce4;hpb=77ec86f4b46f8f39589c07ccd92c21a4c076cc4d;p=jscl.git diff --git a/src/print.lisp b/src/print.lisp index 941b97c..a8ac834 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -16,8 +16,25 @@ ;; 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) + (let ((output "") + (index 0) + (size (length string))) + (while (< index size) + (let ((ch (char string index))) + (when (or (char= ch #\") (char= ch #\\)) + (setq output (concat output "\\"))) + (when (or (char= ch #\newline)) + (setq output (concat output "\\")) + (setq ch #\n)) + (setq output (concat output (string ch)))) + (incf index)) + (concat "\"" output "\""))) + ;;; Return T if the string S contains characters which need to be ;;; escaped to print the symbol name, NIL otherwise. (defun escape-symbol-name-p (s)