lantiga / ki

lisp + mori, sweet.js

Home Page:ki-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

defn can't return non-sexprs

fasterthanlime opened this issue · comments

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 ).

I'm aware of the issue, I had it in my todo list. I'll look into it.

Fixed, closing.

Nice fix! Wouldn't it make sense to specify ident in def forms as well? (Everywhere an identifier is expected, in fact.)

Good point, added ident to def, defn and ns, see 5e81731.