File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 5361
5361
~@(map process-reference references))
5362
5362
(if (.equals '~name 'clojure.core)
5363
5363
nil
5364
- (do (swap! @#'*loaded-libs* conj '~name) nil )))))
5364
+ (do (dosync ( commute @#'*loaded-libs* conj '~name) ) nil )))))
5365
5365
5366
5366
(defmacro refer-clojure
5367
5367
" Same as (refer 'clojure.core <filters>)"
5382
5382
5383
5383
(defonce ^:dynamic
5384
5384
^{:private true
5385
- :doc " An atom around a sorted set of symbols representing loaded libs" }
5386
- *loaded-libs* (atom (sorted-set )))
5385
+ :doc " A ref to a sorted set of symbols representing loaded libs" }
5386
+ *loaded-libs* (ref (sorted-set )))
5387
5387
5388
5388
(defonce ^:dynamic
5389
5389
^{:private true
5454
5454
" namespace '%s' not found after loading '%s'"
5455
5455
lib (root-resource lib))
5456
5456
(when require
5457
- (swap! *loaded-libs* conj lib)))
5457
+ (dosync
5458
+ (commute *loaded-libs* conj lib))))
5458
5459
5459
5460
(defn- load-all
5460
5461
" Loads a lib given its name and forces a load of any libs it directly or
5461
5462
indirectly loads. If need-ns, ensures that the associated namespace
5462
5463
exists after loading. If require, records the load so any duplicate loads
5463
5464
can be skipped."
5464
5465
[lib need-ns require ]
5465
- (swap! *loaded-libs* #(reduce1 conj %1 %2 )
5466
- (binding [*loaded-libs* (atom (sorted-set ))]
5466
+ (dosync
5467
+ (commute *loaded-libs* #(reduce1 conj %1 %2 )
5468
+ (binding [*loaded-libs* (ref (sorted-set ))]
5467
5469
(load-one lib need-ns require )
5468
- @*loaded-libs*)))
5470
+ @*loaded-libs*) )))
5469
5471
5470
5472
(defn- load-lib
5471
5473
" Loads a lib with options"
You can’t perform that action at this time.
0 commit comments