defn can't return non-sexprs
fasterthanlime opened this issue · comments
Amos Wenger commented
The following:
(defn welcome [name]
[:p "Welcome to " name])
Is valid Clojure/ClojureScript as far as I can tell, but it fails with:
[SyntaxError: [macro] Macro `_return_sexprs` could not be matched with `()...`
207:
^]
A workaround is to surround the vector literal with a (do )
.
Luca Antiga commented
I'm aware of the issue, I had it in my todo list. I'll look into it.
Luca Antiga commented
Fixed, closing.
Amos Wenger commented
Nice fix! Wouldn't it make sense to specify ident
in def
forms as well? (Everywhere an identifier is expected, in fact.)
Luca Antiga commented
Good point, added ident to def, defn and ns, see 5e81731.