clojure.core/str behaves differently with nil args

18 views
Skip to first unread message

Michael Gardner

unread,
Nov 6, 2012, 6:54:52 AM11/6/12
to clojure...@googlegroups.com
In clojure-jvm, 'str treats nil arguments as if they were the empty string:

=> (str "a" nil "b")
"ab"

But in clojure-py:

=> (str "a" nil "b")
"aNoneb"

This tripped me up when porting some string-heavy code today.

Eric Shull

unread,
Nov 6, 2012, 8:34:21 AM11/6/12
to clojure...@googlegroups.com
Good catch. Would you file an issue on GitHub so we don't lose it? (https://github.com/halgari/clojure-py/issues)

Eric

Antony Lee

unread,
Nov 6, 2012, 2:22:59 PM11/6/12
to clojure...@googlegroups.com
Fixed :)

Michael Gardner

unread,
Nov 6, 2012, 4:55:49 PM11/6/12
to clojure...@googlegroups.com
Thanks for the quick response! I assume creating a github issue isn't necessary at this point :)
Reply all
Reply to author
Forward
0 new messages