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

namespaces-reference: ns vs in-ns #663

Open
eval opened this issue Aug 4, 2023 · 0 comments
Open

namespaces-reference: ns vs in-ns #663

eval opened this issue Aug 4, 2023 · 0 comments

Comments

@eval
Copy link
Contributor

eval commented Aug 4, 2023

Reading https://clojure.org/reference/namespaces I was a bit surprised how it describes setting up a namespace when REPL-ing (first section, third paragraph):

The best way to set up a new namespace at the top of a Clojure source file is to use the ns macro.
...
At the Repl it's best to use in-ns, in which case the new namespace will contain mappings only for the classnames in java.lang. In order to access the names from the clojure.core namespace you must execute (clojure.core/refer 'clojure.core).

What’s the rationale behind the it's best to use in-ns?
However nice to read what ns does behind the scenes to turn a ‘bare’ namespace into something ‘useable’, it’s not something that seems to be better than ns ?

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

1 participant