From 75c7fa91208033ba8974683430db263fe73182b4 Mon Sep 17 00:00:00 2001 From: Raimon Grau Date: Thu, 2 May 2013 03:46:05 +0200 Subject: [PATCH] reindent --- src/print.lisp | 102 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/print.lisp b/src/print.lisp index 4a3bcdb..7453829 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -22,44 +22,44 @@ (defun write-to-string (form) (cond - ((symbolp form) - (multiple-value-bind (symbol foundp) - (find-symbol (symbol-name form) *package*) - (if (and foundp (eq symbol form)) - (symbol-name form) - (let ((package (symbol-package form)) - (name (symbol-name form))) - (concat (cond - ((null package) "#") - ((eq package (find-package "KEYWORD")) "") - (t (package-name package))) - ":" name))))) - ((integerp form) (integer-to-string form)) - ((floatp form) (float-to-string form)) - ((stringp form) (if *print-escape* - (concat "\"" (escape-string form) "\"") - form)) - ((functionp form) - (let ((name (oget form "fname"))) - (if name - (concat "#") - (concat "#")))) - ((listp form) - (concat "(" - (join-trailing (mapcar #'write-to-string (butlast form)) " ") - (let ((last (last form))) - (if (null (cdr last)) - (write-to-string (car last)) - (concat (write-to-string (car last)) " . " (write-to-string (cdr last))))) - ")")) - ((arrayp form) - (concat "#" (if (zerop (length form)) - "()" - (write-to-string (vector-to-list form))))) - ((packagep form) - (concat "#")) - (t - (concat "#")))) + ((symbolp form) + (multiple-value-bind (symbol foundp) + (find-symbol (symbol-name form) *package*) + (if (and foundp (eq symbol form)) + (symbol-name form) + (let ((package (symbol-package form)) + (name (symbol-name form))) + (concat (cond + ((null package) "#") + ((eq package (find-package "KEYWORD")) "") + (t (package-name package))) + ":" name))))) + ((integerp form) (integer-to-string form)) + ((floatp form) (float-to-string form)) + ((stringp form) (if *print-escape* + (concat "\"" (escape-string form) "\"") + form)) + ((functionp form) + (let ((name (oget form "fname"))) + (if name + (concat "#") + (concat "#")))) + ((listp form) + (concat "(" + (join-trailing (mapcar #'write-to-string (butlast form)) " ") + (let ((last (last form))) + (if (null (cdr last)) + (write-to-string (car last)) + (concat (write-to-string (car last)) " . " (write-to-string (cdr last))))) + ")")) + ((arrayp form) + (concat "#" (if (zerop (length form)) + "()" + (write-to-string (vector-to-list form))))) + ((packagep form) + (concat "#")) + (t + (concat "#")))) (defun prin1-to-string (form) (let ((*print-escape* t)) @@ -92,23 +92,23 @@ (if (char= c #\~) (let ((next (char fmt (incf i)))) (cond - ((char= next #\~) - (setq res (concat res "~"))) - ((char= next #\%) - (setq res (concat res *newline*))) - (t - (setq res (concat res (format-special next (car arguments)))) - (setq arguments (cdr arguments))))) - (setq res (concat res (char-to-string c)))) + ((char= next #\~) + (setq res (concat res "~"))) + ((char= next #\%) + (setq res (concat res *newline*))) + (t + (setq res (concat res (format-special next (car arguments)))) + (setq arguments (cdr arguments))))) + (setq res (concat res (char-to-string c)))) (incf i))) (if destination (progn (write-string res) nil) - res))) + res))) - (defun format-special (chr arg) - (case chr - (#\S (prin1-to-string arg)) - (#\a (princ-to-string arg)))) +(defun format-special (chr arg) + (case chr + (#\S (prin1-to-string arg)) + (#\a (princ-to-string arg)))) -- 1.7.10.4