Just tried the code in SBCL and it definitely gives a compiler warning even without executing the function: This is SBCL 1.5.6, an implementation of ANSI Common Lisp. More information about SBCL is available at . SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the distributi…
Common Lisp isn't my usual dialect but I'd've expected something more like:
(defun add-text-padding (str padding)
(let ((lines (split-string "\n" str)) (
cond
((nil? lines) "")
(#t (join-string "\n"
(cons
(car lines)
(mapcar
(lambda (x)
(concat-string
(repeat-string " " padding) x))
(cdr lines)
)
)
))
)
)
Note: pseudocode typed straight into the comment box, and I dropped the newline feature, but hopefully a bit more illustrative of what I'd consider 'normal' lisp.(comments, criticisms and thrown fruit welcome)