Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defn can't return non-sexprs #15

Closed
fasterthanlime opened this issue Nov 7, 2014 · 4 comments
Closed

defn can't return non-sexprs #15

fasterthanlime opened this issue Nov 7, 2014 · 4 comments

Comments

@fasterthanlime
Copy link
Contributor

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
Copy link
Owner

lantiga commented Nov 7, 2014

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

@lantiga
Copy link
Owner

lantiga commented Nov 8, 2014

Fixed, closing.

@lantiga lantiga closed this as completed Nov 8, 2014
@fasterthanlime
Copy link
Contributor Author

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

@lantiga
Copy link
Owner

lantiga commented Nov 9, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants