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

Are macros implicit args correctly handled? #2

Open
piotr-yuxuan opened this issue Jun 29, 2020 · 2 comments
Open

Are macros implicit args correctly handled? #2

piotr-yuxuan opened this issue Jun 29, 2020 · 2 comments

Comments

@piotr-yuxuan
Copy link

At least on my machine the following code

(lreq/with-lazy-require [[clojure.core.async :as async]]
  (async/go 1))

produces the following error:

Wrong number of args (1) passed to: clojure.core.async/go

which can be worked around with:

(lreq/with-lazy-require [[clojure.core.async :as async]]
  (async/go nil nil 1))

as macros actually take two more implicit arguments: &env and &form.

@piotr-yuxuan
Copy link
Author

Addendum: @alexander-yakushev would you accept PR for this?

@alexander-yakushev
Copy link
Member

Hello @piotr-yuxuan. The biggest problem is that macros must be expanded in compilation time. Hence, you cannot really postpone the loading of a namespace if you need any macros from it.

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

No branches or pull requests

2 participants