|
145 | 145 | (defn all-ns |
146 | 146 | "Return all namespaces. Analagous to clojure.core/all-ns but |
147 | 147 | returns symbols identifying namespaces not Namespace instances." |
148 | | - ([] (all-ns env/*compiler*)) |
| 148 | + ([] |
| 149 | + (all-ns env/*compiler*)) |
149 | 150 | ([state] |
150 | 151 | (keys (get @state ::ana/namespaces)))) |
151 | 152 |
|
152 | 153 | (defn find-ns |
153 | 154 | "Given a namespace return the corresponding namespace analysis map. Analagous |
154 | 155 | to clojure.core/find-ns." |
155 | | - ([sym] (find-ns env/*compiler* sym)) |
| 156 | + ([sym] |
| 157 | + (find-ns env/*compiler* sym)) |
156 | 158 | ([state sym] |
157 | 159 | {:pre [(symbol? sym)]} |
158 | 160 | (get-in @state [::ana/namespaces sym]))) |
159 | 161 |
|
160 | 162 | (defn ns-interns |
161 | 163 | "Given a namespace return all the var analysis maps. Analagous to |
162 | 164 | clojure.core/ns-interns but returns var analysis maps not vars." |
163 | | - ([ns] (ns-interns env/*compiler*)) |
| 165 | + ([ns] |
| 166 | + (ns-interns env/*compiler* ns)) |
164 | 167 | ([state ns] |
165 | 168 | {:pre [(symbol? ns)]} |
166 | 169 | (merge |
|
170 | 173 | (defn ns-publics |
171 | 174 | "Given a namespace return all the public var analysis maps. Analagous to |
172 | 175 | clojure.core/ns-publics but returns var analysis maps not vars." |
173 | | - ([ns] (ns-publics env/*compiler*)) |
| 176 | + ([ns] |
| 177 | + (ns-publics env/*compiler* ns)) |
174 | 178 | ([state ns] |
175 | 179 | {:pre [(symbol? ns)]} |
176 | 180 | (->> (merge |
|
182 | 186 | (defn ns-resolve |
183 | 187 | "Given a namespace and a symbol return the corresponding var analysis map. |
184 | 188 | Analagous to clojure.core/ns-resolve but returns var analysis map not Var." |
185 | | - ([ns sym] (ns-resolve env/*compiler* ns sym)) |
| 189 | + ([ns sym] |
| 190 | + (ns-resolve env/*compiler* ns sym)) |
186 | 191 | ([state ns sym] |
187 | 192 | {:pre [(symbol? ns) (symbol? sym)]} |
188 | 193 | (get-in @state [::ana/namespaces ns :defs sym]))) |
189 | 194 |
|
190 | 195 | (defn remove-ns |
191 | 196 | "Removes the namespace named by the symbol." |
192 | | - ([ns] (remove-ns env/*compiler* ns)) |
| 197 | + ([ns] |
| 198 | + (remove-ns env/*compiler* ns)) |
193 | 199 | ([state ns] |
194 | 200 | {:pre [(symbol? ns)]} |
195 | 201 | (swap! state update-in [::ana/namespaces] dissoc ns))) |
|
0 commit comments