Skip to content

namespaces-reference: ns vs in-ns #663

Description

@eval

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 ?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions