当前的文档字符串
clojure.core/keyword
([name] [ns name])
Returns a Keyword with the given namespace and name. Do not use :
in the keyword strings, it will be added automatically.
clojure.core/symbol
([name] [ns name])
Returns a Symbol with the given namespace and name. Arity-1 works
on strings, keywords, and vars.
参数列表表明第一个参数用于简单的标识符。
然而,底层实现明确处理了值中包含 `/
` 的情况,甚至参数还命名为 `nsname
`
static public Symbol intern(String nsname){
int i = nsname.indexOf('/');
if(i == -1 || nsname.equals("/"))
return new Symbol(null, nsname);
else
return new Symbol(nsname.substring(0, i), nsname.substring(i + 1));
}
一个示例,一些现有的代码依赖于此行为: transit-clj
也许,文档字符串应该更新以反映这一点?