Lisp format directive that interprets nil argument to empty string instead of “NIL”

落爺英雄遲暮 提交于 2019-12-10 14:18:13

问题


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)
""


来源:https://stackoverflow.com/questions/5729032/lisp-format-directive-that-interprets-nil-argument-to-empty-string-instead-of-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!