Lisp format directive that interprets nil argument

2019-06-22 12:25发布

问题:

I know I can process the argument before passing it, I just wonder if there is a directive for this

回答1:

CL-USER> (format nil "~@[~A~]" "foo")
"foo"
CL-USER> (format nil "~@[~A~]" nil)
""