From 8e45362a510236f46f97b6c275b2b8014678f77d Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 14 May 2017 17:08:16 +0200 Subject: Format NILs as empty strings. --- formatters.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'formatters.lisp') diff --git a/formatters.lisp b/formatters.lisp index a16ad93..a183b59 100644 --- a/formatters.lisp +++ b/formatters.lisp @@ -23,7 +23,9 @@ (escapee-p (lambda (x) (member x escapees :test #'char=)))) (lambda (string) (unless (stringp string) - (setq string (format nil "~A" string))) + (typecase string + (null (setq string "")) + (t (setq string (format nil "~A" string))))) (with-output-to-string (out) (loop with position = 0 for escapee-pos = (position-if escapee-p string :start position) @@ -38,7 +40,9 @@ (defun escape-for-uri (string) (unless (stringp string) - (setq string (format nil "~A" string))) + (typecase string + (null (setq string "")) + (t (setq string (format nil "~A" string))))) (with-output-to-string (out) (map 'list (lambda (char) -- cgit v1.2.3