Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

namespaces-reference: ns vs in-ns

Aperta
#663 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
clojure
Ambito
documentation

Direzione di ricerca

Inizia con il riferimento ai namespaces all’indirizzo https://clojure.org/reference/namespaces, in particolare la prima sezione e il terzo paragrafo. Confronta gli usi documentati di ns e in-ns, poi chiarisci la motivazione per cui si raccomanda in-ns nella REPL; il lavoro è completato quando la formulazione spiega perché viene preferito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 ?

Lingua principale
HTML
Stelle
259
Fork
275
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clojure/clojure-site

Tutte le issue di clojure/clojure-site

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.