lantiga / ki

lisp + mori, sweet.js
ki-lang.org
MIT License
478 stars 28 forks source link

defn can't return non-sexprs #15

Closed fasterthanlime closed 9 years ago

fasterthanlime commented 9 years ago

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

lantiga commented 9 years ago

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

lantiga commented 9 years ago

Fixed, closing.

fasterthanlime commented 9 years ago

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

lantiga commented 9 years ago

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