|
|
|
|
|
by mkremins
4331 days ago
|
|
Both :use and :require :refer :all slurp symbols into your namespace unqualified. This behavior can cause confusion when someone reading your code tries to figure out which symbols are defined where. Most of the time, more explicit alternatives are preferred: (:require [foo :as f])
gives the required namespace a short alias with which symbols defined in that namespace can be qualified, while (:require [foo :refer [bar baz quux]])
explicitly provides a set of symbols to import unqualified.Generally speaking, :require :refer :all is also considered non-idiomatic. In fact, ClojureScript has explicitly avoided supporting both :require :refer :all and naked :use [1]. Backwards compatibility seems to be the only reason either is still supported by Clojure on the JVM. [1] https://groups.google.com/forum/#!msg/clojurescript/SzYK08Od... |
|
I guess a popular example is `(:use clojure.test)`