(format nil "~@[~A~]" "foo") "foo" CL-USER> (forma-6ren">
gpt4 book ai didi

将 nil 参数解释为空字符串而不是 "NIL"的 Lisp 格式指令

转载 作者:太空宇宙 更新时间:2023-11-03 18:37:48 25 4
gpt4 key购买 nike

我知道我可以在传递参数之前对其进行处理,我只是想知道是否有针对此的指令

最佳答案

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

关于将 nil 参数解释为空字符串而不是 "NIL"的 Lisp 格式指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5729032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com