将nil参数解释为空字符串而不是“NIL”的Lisp格式指令。 [英] Lisp format directive that interprets nil argument to empty string instead of "NIL"

查看:200
本文介绍了将nil参数解释为空字符串而不是“NIL”的Lisp格式指令。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以在传递它之前处理这个参数,我只是想知道是否有一个指令可以解决这个问题。

解决方案

CL-使用者> (格式nil〜@ [〜A〜]foo)
foo
CL-USER> (格式nil〜@ [〜A〜]nil)


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

解决方案

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

这篇关于将nil参数解释为空字符串而不是“NIL”的Lisp格式指令。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆