File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 2
2
(:require [clojure.string :as str]
3
3
[clojure.set :as set]))
4
4
5
+ (def impl-local-sym '+impl+ )
6
+
5
7
(defn normalize-argv [argv]
6
8
{:post [(or (empty? %)
7
- (apply distinct? %))]}
9
+ (apply distinct? %))
10
+ (not-any? #{impl-local-sym} %)]}
8
11
(into [] (map-indexed (fn [i arg]
9
12
(if (symbol? arg)
10
13
(do (assert (not (namespace arg)))
29
32
forward-meta (into (sorted-map ) (select-keys m [:doc :tag :deprecated ]))
30
33
forward-meta (cond-> forward-meta
31
34
(nil? (:tag forward-meta)) (dissoc :tag ))
32
- impl '+ impl+ ]
35
+ _ ( assert ( not= n impl-local-sym)) ]
33
36
(when (:macro m)
34
37
(throw (IllegalArgumentException.
35
38
(str " Calling import-fn on a macro: " sym))))
36
- (list 'let [impl (list 'delay
37
- (list 'load-java-time)
38
- (list 'deref (list 'resolve (list 'quote sym))))]
39
+ (list 'let [impl-local-sym (list 'delay
40
+ (list 'load-java-time)
41
+ (list 'deref (list 'resolve (list 'quote sym))))]
39
42
(list* 'defn n
40
43
(concat
41
44
(some-> (not-empty forward-meta) list)
44
47
(let [argv (normalize-argv argv)]
45
48
(list argv
46
49
(if (some #{'&} argv)
47
- (list* 'apply (list 'deref impl) (remove #{'&} argv))
48
- (list* (list 'deref impl) argv)))))
50
+ (list* 'apply (list 'deref impl-local-sym ) (remove #{'&} argv))
51
+ (list* (list 'deref impl-local-sym ) argv)))))
49
52
arglists)))))))
50
53
51
54
(defn import-macro [sym]
You can’t perform that action at this time.
0 commit comments