summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/clj/clojure/core.clj412
-rw-r--r--src/clj/clojure/core/protocols.clj2
-rw-r--r--src/clj/clojure/core_deftype.clj26
-rw-r--r--src/clj/clojure/core_print.clj88
-rw-r--r--src/clj/clojure/core_proxy.clj58
-rw-r--r--src/clj/clojure/genclass.clj52
-rw-r--r--src/clj/clojure/gvec.clj60
-rw-r--r--src/clj/clojure/inspector.clj2
-rw-r--r--src/clj/clojure/main.clj8
-rw-r--r--src/clj/clojure/parallel.clj2
-rw-r--r--src/clj/clojure/set.clj2
-rw-r--r--src/clj/clojure/stacktrace.clj2
-rw-r--r--src/clj/clojure/template.clj2
-rw-r--r--src/clj/clojure/test.clj12
-rw-r--r--src/clj/clojure/test/junit.clj4
-rw-r--r--src/clj/clojure/test/tap.clj4
-rw-r--r--src/clj/clojure/walk.clj2
-rw-r--r--src/clj/clojure/xml.clj8
-rw-r--r--src/clj/clojure/zip.clj4
19 files changed, 375 insertions, 375 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index b2b08661..48da4fc3 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -6,7 +6,7 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(ns #^{:doc "The core Clojure language."
+(ns ^{:doc "The core Clojure language."
:author "Rich Hickey"}
clojure.core)
@@ -14,12 +14,12 @@
(def unquote-splicing)
(def
- #^{:arglists '([& items])
+ ^{:arglists '([& items])
:doc "Creates a new list containing the items."}
list (. clojure.lang.PersistentList creator))
(def
- #^{:arglists '([x seq])
+ ^{:arglists '([x seq])
:doc "Returns a new seq where x is the first element and seq is
the rest."}
@@ -27,41 +27,41 @@
;during bootstrap we don't have destructuring let, loop or fn, will redefine later
(def
- #^{:macro true}
+ ^{:macro true}
let (fn* let [&form &env & decl] (cons 'let* decl)))
(def
- #^{:macro true}
+ ^{:macro true}
loop (fn* loop [&form &env & decl] (cons 'loop* decl)))
(def
- #^{:macro true}
+ ^{:macro true}
fn (fn* fn [&form &env & decl]
- (.withMeta #^clojure.lang.IObj (cons 'fn* decl)
- (.meta #^clojure.lang.IMeta &form))))
+ (.withMeta ^clojure.lang.IObj (cons 'fn* decl)
+ (.meta ^clojure.lang.IMeta &form))))
(def
- #^{:arglists '([coll])
+ ^{:arglists '([coll])
:doc "Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil."}
first (fn first [coll] (. clojure.lang.RT (first coll))))
(def
- #^{:arglists '([coll])
+ ^{:arglists '([coll])
:tag clojure.lang.ISeq
:doc "Returns a seq of the items after the first. Calls seq on its
argument. If there are no more items, returns nil."}
next (fn next [x] (. clojure.lang.RT (next x))))
(def
- #^{:arglists '([coll])
+ ^{:arglists '([coll])
:tag clojure.lang.ISeq
:doc "Returns a possibly empty seq of the items after the first. Calls seq on its
argument."}
rest (fn rest [x] (. clojure.lang.RT (more x))))
(def
- #^{:arglists '([coll x] [coll x & xs])
+ ^{:arglists '([coll x] [coll x & xs])
:doc "conj[oin]. Returns a new collection with the xs
'added'. (conj nil item) returns (item). The 'addition' may
happen at different 'places' depending on the concrete type."}
@@ -73,32 +73,32 @@
(conj coll x)))))
(def
- #^{:doc "Same as (first (next x))"
+ ^{:doc "Same as (first (next x))"
:arglists '([x])}
second (fn second [x] (first (next x))))
(def
- #^{:doc "Same as (first (first x))"
+ ^{:doc "Same as (first (first x))"
:arglists '([x])}
ffirst (fn ffirst [x] (first (first x))))
(def
- #^{:doc "Same as (next (first x))"
+ ^{:doc "Same as (next (first x))"
:arglists '([x])}
nfirst (fn nfirst [x] (next (first x))))
(def
- #^{:doc "Same as (first (next x))"
+ ^{:doc "Same as (first (next x))"
:arglists '([x])}
fnext (fn fnext [x] (first (next x))))
(def
- #^{:doc "Same as (next (next x))"
+ ^{:doc "Same as (next (next x))"
:arglists '([x])}
nnext (fn nnext [x] (next (next x))))
(def
- #^{:arglists '([coll])
+ ^{:arglists '([coll])
:doc "Returns a seq on the collection. If the collection is
empty, returns nil. (seq nil) returns nil. seq also works on
Strings, native Java arrays (of reference types) and any objects
@@ -107,38 +107,38 @@
seq (fn seq [coll] (. clojure.lang.RT (seq coll))))
(def
- #^{:arglists '([#^Class c x])
+ ^{:arglists '([^Class c x])
:doc "Evaluates x and tests if it is an instance of the class
c. Returns true or false"}
- instance? (fn instance? [#^Class c x] (. c (isInstance x))))
+ instance? (fn instance? [^Class c x] (. c (isInstance x))))
(def
- #^{:arglists '([x])
+ ^{:arglists '([x])
:doc "Return true if x implements ISeq"}
seq? (fn seq? [x] (instance? clojure.lang.ISeq x)))
(def
- #^{:arglists '([x])
+ ^{:arglists '([x])
:doc "Return true if x is a Character"}
char? (fn char? [x] (instance? Character x)))
(def
- #^{:arglists '([x])
+ ^{:arglists '([x])
:doc "Return true if x is a String"}
string? (fn string? [x] (instance? String x)))
(def
- #^{:arglists '([x])
+ ^{:arglists '([x])
:doc "Return true if x implements IPersistentMap"}
map? (fn map? [x] (instance? clojure.lang.IPersistentMap x)))
(def
- #^{:arglists '([x])
+ ^{:arglists '([x])
:doc "Return true if x implements IPersistentVector "}
vector? (fn vector? [x] (instance? clojure.lang.IPersistentVector x)))
(def
- #^{:arglists '([map key val] [map key val & kvs])
+ ^{:arglists '([map key val] [map key val & kvs])
:doc "assoc[iate]. When applied to a map, returns a new map of the
same (hashed/sorted) type, that contains the mapping of key(s) to
val(s). When applied to a vector, returns a new vector that
@@ -154,21 +154,21 @@
;;;;;;;;;;;;;;;;; metadata ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def
- #^{:arglists '([obj])
+ ^{:arglists '([obj])
:doc "Returns the metadata of obj, returns nil if there is no metadata."}
meta (fn meta [x]
(if (instance? clojure.lang.IMeta x)
- (. #^clojure.lang.IMeta x (meta)))))
+ (. ^clojure.lang.IMeta x (meta)))))
(def
- #^{:arglists '([#^clojure.lang.IObj obj m])
+ ^{:arglists '([^clojure.lang.IObj obj m])
:doc "Returns an object of the same type and value as obj, with
map m as its metadata."}
- with-meta (fn with-meta [#^clojure.lang.IObj x m]
+ with-meta (fn with-meta [^clojure.lang.IObj x m]
(. x (withMeta m))))
(def
- #^{:private true}
+ ^{:private true}
sigs
(fn [fdecl]
(let [asig
@@ -193,7 +193,7 @@
(def
- #^{:arglists '([coll])
+ ^{:arglists '([coll])
:doc "Return the last item in coll, in linear time"}
last (fn last [s]
(if (next s)
@@ -201,7 +201,7 @@
(first s))))
(def
- #^{:arglists '([coll])
+ ^{:arglists '([coll])
:doc "Return a seq of all but the last item in coll, in linear time"}
butlast (fn butlast [s]
(loop [ret [] s s]
@@ -211,7 +211,7 @@
(def
- #^{:doc "Same as (def name (fn [params* ] exprs*)) or (def
+ ^{:doc "Same as (def name (fn [params* ] exprs*)) or (def
name (fn ([params* ] exprs*)+)) with any doc-string or attrs added
to the var metadata"
:arglists '([name doc-string? attr-map? [params*] body]
@@ -256,7 +256,7 @@
(defn cast
"Throws a ClassCastException if x is not a c, else returns x."
- [#^Class c x]
+ [^Class c x]
(. c (cast x)))
(defn to-array
@@ -322,7 +322,7 @@
(def
- #^{:doc "Like defn, but the resulting function name is declared as a
+ ^{:doc "Like defn, but the resulting function name is declared as a
macro and will be used as a macro by the compiler when it is
called."
:arglists '([name doc-string? attr-map? [params*] body]
@@ -399,14 +399,14 @@
one arg, returns the concatenation of the str values of the args."
{:tag String}
([] "")
- ([#^Object x]
+ ([^Object x]
(if (nil? x) "" (. x (toString))))
([x & ys]
- ((fn [#^StringBuilder sb more]
+ ((fn [^StringBuilder sb more]
(if more
(recur (. sb (append (str (first more)))) (next more))
(str sb)))
- (new StringBuilder #^String (str x)) ys)))
+ (new StringBuilder ^String (str x)) ys)))
(defn symbol?
@@ -449,8 +449,8 @@
in the keyword strings, it will be added automatically."
{:tag clojure.lang.Keyword}
([name] (cond (keyword? name) name
- (symbol? name) (clojure.lang.Keyword/intern #^clojure.lang.Symbol name)
- (string? name) (clojure.lang.Keyword/intern #^String name)))
+ (symbol? name) (clojure.lang.Keyword/intern ^clojure.lang.Symbol name)
+ (string? name) (clojure.lang.Keyword/intern ^String name)))
([ns name] (clojure.lang.Keyword/intern ns name)))
(defn spread
@@ -474,15 +474,15 @@
(defn apply
"Applies fn f to the argument list formed by prepending args to argseq."
{:arglists '([f args* argseq])}
- ([#^clojure.lang.IFn f args]
+ ([^clojure.lang.IFn f args]
(. f (applyTo (seq args))))
- ([#^clojure.lang.IFn f x args]
+ ([^clojure.lang.IFn f x args]
(. f (applyTo (list* x args))))
- ([#^clojure.lang.IFn f x y args]
+ ([^clojure.lang.IFn f x y args]
(. f (applyTo (list* x y args))))
- ([#^clojure.lang.IFn f x y z args]
+ ([^clojure.lang.IFn f x y z args]
(. f (applyTo (list* x y z args))))
- ([#^clojure.lang.IFn f a b c d & args]
+ ([^clojure.lang.IFn f a b c d & args]
(. f (applyTo (cons a (cons b (cons c (cons d (spread args)))))))))
(defn vary-meta
@@ -497,24 +497,24 @@
is called, and will cache the result and return it on all subsequent
seq calls."
[& body]
- (list 'new 'clojure.lang.LazySeq (list* '#^{:once true} fn* [] body)))
+ (list 'new 'clojure.lang.LazySeq (list* '^{:once true} fn* [] body)))
-(defn #^clojure.lang.ChunkBuffer chunk-buffer [capacity]
+(defn ^clojure.lang.ChunkBuffer chunk-buffer [capacity]
(clojure.lang.ChunkBuffer. capacity))
-(defn chunk-append [#^clojure.lang.ChunkBuffer b x]
+(defn chunk-append [^clojure.lang.ChunkBuffer b x]
(.add b x))
-(defn chunk [#^clojure.lang.ChunkBuffer b]
+(defn chunk [^clojure.lang.ChunkBuffer b]
(.chunk b))
-(defn #^clojure.lang.IChunk chunk-first [#^clojure.lang.IChunkedSeq s]
+(defn ^clojure.lang.IChunk chunk-first [^clojure.lang.IChunkedSeq s]
(.chunkedFirst s))
-(defn #^clojure.lang.ISeq chunk-rest [#^clojure.lang.IChunkedSeq s]
+(defn ^clojure.lang.ISeq chunk-rest [^clojure.lang.IChunkedSeq s]
(.chunkedMore s))
-(defn #^clojure.lang.ISeq chunk-next [#^clojure.lang.IChunkedSeq s]
+(defn ^clojure.lang.ISeq chunk-next [^clojure.lang.IChunkedSeq s]
(.chunkedNext s))
(defn chunk-cons [chunk rest]
@@ -557,7 +557,7 @@
will cache the result and return it on all subsequent force
calls."
[& body]
- (list 'new 'clojure.lang.Delay (list* `#^{:once true} fn* [] body)))
+ (list 'new 'clojure.lang.Delay (list* `^{:once true} fn* [] body)))
(defn delay?
"returns true if x is a Delay created with delay"
@@ -1040,7 +1040,7 @@
"disj[oin]. Returns a new set of the same (hashed/sorted) type, that
does not contain key(s)."
([set] set)
- ([#^clojure.lang.IPersistentSet set key]
+ ([^clojure.lang.IPersistentSet set key]
(. set (disjoin key)))
([set key & ks]
(let [ret (disj set key)]
@@ -1075,30 +1075,30 @@
(defn key
"Returns the key of the map entry."
- [#^java.util.Map$Entry e]
+ [^java.util.Map$Entry e]
(. e (getKey)))
(defn val
"Returns the value in the map entry."
- [#^java.util.Map$Entry e]
+ [^java.util.Map$Entry e]
(. e (getValue)))
(defn rseq
"Returns, in constant time, a seq of the items in rev (which
can be a vector or sorted-map), in reverse order. If rev is empty returns nil"
- [#^clojure.lang.Reversible rev]
+ [^clojure.lang.Reversible rev]
(. rev (rseq)))
(defn name
"Returns the name String of a symbol or keyword."
{:tag String}
- [#^clojure.lang.Named x]
+ [^clojure.lang.Named x]
(. x (getName)))
(defn namespace
"Returns the namespace String of a symbol or keyword, or nil if not present."
{:tag String}
- [#^clojure.lang.Named x]
+ [^clojure.lang.Named x]
(. x (getNamespace)))
(defmacro locking
@@ -1201,36 +1201,36 @@
(defn remove-all-methods
"Removes all of the methods of multimethod."
- [#^clojure.lang.MultiFn multifn]
+ [^clojure.lang.MultiFn multifn]
(.reset multifn))
(defn remove-method
"Removes the method of multimethod associated with dispatch-value."
- [#^clojure.lang.MultiFn multifn dispatch-val]
+ [^clojure.lang.MultiFn multifn dispatch-val]
(. multifn removeMethod dispatch-val))
(defn prefer-method
"Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y
when there is a conflict"
- [#^clojure.lang.MultiFn multifn dispatch-val-x dispatch-val-y]
+ [^clojure.lang.MultiFn multifn dispatch-val-x dispatch-val-y]
(. multifn preferMethod dispatch-val-x dispatch-val-y))
(defn methods
"Given a multimethod, returns a map of dispatch values -> dispatch fns"
- [#^clojure.lang.MultiFn multifn] (.getMethodTable multifn))
+ [^clojure.lang.MultiFn multifn] (.getMethodTable multifn))
(defn get-method
"Given a multimethod and a dispatch value, returns the dispatch fn
that would apply to that value, or nil if none apply and no default"
- [#^clojure.lang.MultiFn multifn dispatch-val] (.getMethod multifn dispatch-val))
+ [^clojure.lang.MultiFn multifn dispatch-val] (.getMethod multifn dispatch-val))
(defn prefers
"Given a multimethod, returns a map of preferred value -> set of other values"
- [#^clojure.lang.MultiFn multifn] (.getPreferTable multifn))
+ [^clojure.lang.MultiFn multifn] (.getPreferTable multifn))
;;;;;;;;; var stuff
-(defmacro #^{:private true} assert-args [fnname & pairs]
+(defmacro ^{:private true} assert-args [fnname & pairs]
`(do (when-not ~(first pairs)
(throw (IllegalArgumentException.
~(str fnname " requires " (second pairs)))))
@@ -1365,8 +1365,8 @@
[sym] (. clojure.lang.Var (find sym)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Refs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defn #^{:private true}
- setup-reference [#^clojure.lang.ARef r options]
+(defn ^{:private true}
+ setup-reference [^clojure.lang.ARef r options]
(let [opts (apply hash-map options)]
(when (:meta opts)
(.resetMeta r (:meta opts)))
@@ -1412,7 +1412,7 @@
will be set to the value of:
(apply action-fn state-of-agent args)"
- [#^clojure.lang.Agent a f & args]
+ [^clojure.lang.Agent a f & args]
(. a (dispatch f args false)))
(defn send-off
@@ -1421,7 +1421,7 @@
the agent will be set to the value of:
(apply action-fn state-of-agent args)"
- [#^clojure.lang.Agent a f & args]
+ [^clojure.lang.Agent a f & args]
(. a (dispatch f args true)))
(defn release-pending-sends
@@ -1448,19 +1448,19 @@
set!s. Keys must be unique per reference, and can be used to remove
the watch with remove-watch, but are otherwise considered opaque by
the watch mechanism."
- [#^clojure.lang.IRef reference key fn] (.addWatch reference key fn))
+ [^clojure.lang.IRef reference key fn] (.addWatch reference key fn))
(defn remove-watch
"Alpha - subject to change.
Removes a watch (set by add-watch) from a reference"
- [#^clojure.lang.IRef reference key]
+ [^clojure.lang.IRef reference key]
(.removeWatch reference key))
(defn agent-error
"Returns the exception thrown during an asynchronous action of the
agent if the agent is failed. Returns nil if the agent is not
failed."
- [#^clojure.lang.Agent a] (.getError a))
+ [^clojure.lang.Agent a] (.getError a))
(defn restart-agent
"When an agent is failed, changes the agent state to new-state and
@@ -1472,7 +1472,7 @@
agent will remain failed with its old state and error. Watchers, if
any, will NOT be notified of the new state. Throws an exception if
the agent is not failed."
- [#^clojure.lang.Agent a, new-state & options]
+ [^clojure.lang.Agent a, new-state & options]
(let [opts (apply hash-map options)]
(.restart a new-state (if (:clear-actions opts) true false))))
@@ -1481,13 +1481,13 @@
being run by the agent throws an exception or doesn't pass the
validator fn, handler-fn will be called with two arguments: the
agent and the exception."
- [#^clojure.lang.Agent a, handler-fn]
+ [^clojure.lang.Agent a, handler-fn]
(.setErrorHandler a handler-fn))
(defn error-handler
"Returns the error-handler of agent a, or nil if there is none.
See set-error-handler!"
- [#^clojure.lang.Agent a]
+ [^clojure.lang.Agent a]
(.getErrorHandler a))
(defn set-error-mode!
@@ -1502,12 +1502,12 @@
accepting new 'send' and 'send-off' actions, and any previously
queued actions will be held until a 'restart-agent'. Deref will
still work, returning the state of the agent before the error."
- [#^clojure.lang.Agent a, mode-keyword]
+ [^clojure.lang.Agent a, mode-keyword]
(.setErrorMode a mode-keyword))
(defn error-mode
"Returns the error-mode of agent a. See set-error-mode!"
- [#^clojure.lang.Agent a]
+ [^clojure.lang.Agent a]
(.getErrorMode a))
(defn agent-errors
@@ -1522,7 +1522,7 @@
"DEPRECATED: Use 'restart-agent' instead.
Clears any exceptions thrown during asynchronous actions of the
agent, allowing subsequent actions to occur."
- [#^clojure.lang.Agent a] (restart-agent a (.deref a)))
+ [^clojure.lang.Agent a] (restart-agent a (.deref a)))
(defn shutdown-agents
"Initiates a shutdown of the thread pools that back the agent
@@ -1555,7 +1555,7 @@
with :max-history."
([x] (new clojure.lang.Ref x))
([x & options]
- (let [r #^clojure.lang.Ref (setup-reference (ref x) options)
+ (let [r ^clojure.lang.Ref (setup-reference (ref x) options)
opts (apply hash-map options)]
(when (:max-history opts)
(.setMaxHistory r (:max-history opts)))
@@ -1570,7 +1570,7 @@
or atom, returns its current state. When applied to a delay, forces
it if not already forced. When applied to a future, will block if
computation not complete"
- [#^clojure.lang.IDeref ref] (.deref ref))
+ [^clojure.lang.IDeref ref] (.deref ref))
(defn atom
"Creates and returns an Atom with an initial value of x and zero or
@@ -1593,21 +1593,21 @@
(apply f current-value-of-atom args). Note that f may be called
multiple times, and thus should be free of side effects. Returns
the value that was swapped in."
- ([#^clojure.lang.Atom atom f] (.swap atom f))
- ([#^clojure.lang.Atom atom f x] (.swap atom f x))
- ([#^clojure.lang.Atom atom f x y] (.swap atom f x y))
- ([#^clojure.lang.Atom atom f x y & args] (.swap atom f x y args)))
+ ([^clojure.lang.Atom atom f] (.swap atom f))
+ ([^clojure.lang.Atom atom f x] (.swap atom f x))
+ ([^clojure.lang.Atom atom f x y] (.swap atom f x y))
+ ([^clojure.lang.Atom atom f x y & args] (.swap atom f x y args)))
(defn compare-and-set!
"Atomically sets the value of atom to newval if and only if the
current value of the atom is identical to oldval. Returns true if
set happened, else false"
- [#^clojure.lang.Atom atom oldval newval] (.compareAndSet atom oldval newval))
+ [^clojure.lang.Atom atom oldval newval] (.compareAndSet atom oldval newval))
(defn reset!
"Sets the value of atom to newval without regard for the
current value. Returns newval."
- [#^clojure.lang.Atom atom newval] (.reset atom newval))
+ [^clojure.lang.Atom atom newval] (.reset atom newval))
(defn set-validator!
"Sets the validator-fn for a var/ref/agent/atom. validator-fn must be nil or a
@@ -1616,11 +1616,11 @@
validator-fn should return false or throw an exception. If the current state (root
value if var) is not acceptable to the new validator, an exception
will be thrown and the validator will not be changed."
- [#^clojure.lang.IRef iref validator-fn] (. iref (setValidator validator-fn)))
+ [^clojure.lang.IRef iref validator-fn] (. iref (setValidator validator-fn)))
(defn get-validator
"Gets the validator-fn for a var/ref/agent/atom."
- [#^clojure.lang.IRef iref] (. iref (getValidator)))
+ [^clojure.lang.IRef iref] (. iref (getValidator)))
(defn alter-meta!
"Atomically sets the metadata for a namespace/var/ref/agent/atom to be:
@@ -1628,11 +1628,11 @@
(apply f its-current-meta args)
f must be free of side-effects"
- [#^clojure.lang.IReference iref f & args] (.alterMeta iref f args))
+ [^clojure.lang.IReference iref f & args] (.alterMeta iref f args))
(defn reset-meta!
"Atomically resets the metadata for a namespace/var/ref/agent/atom"
- [#^clojure.lang.IReference iref metadata-map] (.resetMeta iref metadata-map))
+ [^clojure.lang.IReference iref metadata-map] (.resetMeta iref metadata-map))
(defn commute
"Must be called in a transaction. Sets the in-transaction-value of
@@ -1650,7 +1650,7 @@
last-one-in-wins behavior. commute allows for more concurrency than
ref-set."
- [#^clojure.lang.Ref ref fun & args]
+ [^clojure.lang.Ref ref fun & args]
(. ref (commute fun args)))
(defn alter
@@ -1660,39 +1660,39 @@
(apply fun in-transaction-value-of-ref args)
and returns the in-transaction-value of ref."
- [#^clojure.lang.Ref ref fun & args]
+ [^clojure.lang.Ref ref fun & args]
(. ref (alter fun args)))
(defn ref-set
"Must be called in a transaction. Sets the value of ref.
Returns val."
- [#^clojure.lang.Ref ref val]
+ [^clojure.lang.Ref ref val]
(. ref (set val)))
(defn ref-history-count
"Returns the history count of a ref"
- [#^clojure.lang.Ref ref]
+ [^clojure.lang.Ref ref]
(.getHistoryCount ref))
(defn ref-min-history
"Gets the min-history of a ref, or sets it and returns the ref"
- ([#^clojure.lang.Ref ref]
+ ([^clojure.lang.Ref ref]
(.getMinHistory ref))
- ([#^clojure.lang.Ref ref n]
+ ([^clojure.lang.Ref ref n]
(.setMinHistory ref n)))
(defn ref-max-history
"Gets the max-history of a ref, or sets it and returns the ref"
- ([#^clojure.lang.Ref ref]
+ ([^clojure.lang.Ref ref]
(.getMaxHistory ref))
- ([#^clojure.lang.Ref ref n]
+ ([^clojure.lang.Ref ref n]
(.setMaxHistory ref n)))
(defn ensure
"Must be called in a transaction. Protects the ref from modification
by other transactions. Returns the in-transaction-value of
ref. Allows for more concurrency than (ref-set ref @ref)"
- [#^clojure.lang.Ref ref]
+ [^clojure.lang.Ref ref]
(. ref (touch))
(. ref (deref)))
@@ -1821,7 +1821,7 @@
:else false))
(def
- #^{:tag Boolean
+ ^{:tag Boolean
:doc "Returns false if (pred x) is logical true for every x in
coll, else true."
:arglists '([pred coll])}
@@ -1837,7 +1837,7 @@
(or (pred (first coll)) (recur pred (next coll)))))
(def
- #^{:tag Boolean
+ ^{:tag Boolean
:doc "Returns false if (pred x) is logical true for any x in coll,
else true."
:arglists '([pred coll])}
@@ -2073,7 +2073,7 @@
(defn line-seq
"Returns the lines of text from rdr as a lazy sequence of strings.
rdr must implement java.io.BufferedReader."
- [#^java.io.BufferedReader rdr]
+ [^java.io.BufferedReader rdr]
(when-let [line (.readLine rdr)]
(cons line (lazy-seq (line-seq rdr)))))
@@ -2089,7 +2089,7 @@
implement java.util.Comparator."
([coll]
(sort compare coll))
- ([#^java.util.Comparator comp coll]
+ ([^java.util.Comparator comp coll]
(if (seq coll)
(let [a (to-array coll)]
(. java.util.Arrays (sort a comp))
@@ -2103,7 +2103,7 @@
implement java.util.Comparator."
([keyfn coll]
(sort-by keyfn compare coll))
- ([keyfn #^java.util.Comparator comp coll]
+ ([keyfn ^java.util.Comparator comp coll]
(sort (fn [x y] (. comp (compare (keyfn x) (keyfn y)))) coll)))
(defn partition
@@ -2233,7 +2233,7 @@
(send agent count-down))
(. latch (await)))))
-(defn await1 [#^clojure.lang.Agent a]
+(defn await1 [^clojure.lang.Agent a]
(when (pos? (.getQueueCount a))
(await a))
a)
@@ -2307,13 +2307,13 @@
([type aseq]
(clojure.lang.RT/seqToTypedArray type (seq aseq))))
-(defn #^{:private true}
+(defn ^{:private true}
array [& items]
(into-array items))
-(defn #^Class class
+(defn ^Class class
"Returns the Class of x"
- [#^Object x] (if (nil? x) x (. x (getClass))))
+ [^Object x] (if (nil? x) x (. x (getClass))))
(defn type
"Returns the :type metadata of x, or its Class if none"
@@ -2330,31 +2330,31 @@
"Coerce to long"
{:tag Long
:inline (fn [x] `(. clojure.lang.RT (longCast ~x)))}
- [#^Number x] (. x (longValue)))
+ [^Number x] (. x (longValue)))
(defn float
"Coerce to float"
{:tag Float
:inline (fn [x] `(. clojure.lang.RT (floatCast ~x)))}
- [#^Number x] (. x (floatValue)))
+ [^Number x] (. x (floatValue)))
(defn double
"Coerce to double"
{:tag Double
:inline (fn [x] `(. clojure.lang.RT (doubleCast ~x)))}
- [#^Number x] (. x (doubleValue)))
+ [^Number x] (. x (doubleValue)))
(defn short
"Coerce to short"
{:tag Short
:inline (fn [x] `(. clojure.lang.RT (shortCast ~x)))}
- [#^Number x] (. x (shortValue)))
+ [^Number x] (. x (shortValue)))
(defn byte
"Coerce to byte"
{:tag Byte
:inline (fn [x] `(. clojure.lang.RT (byteCast ~x)))}
- [#^Number x] (. x (byteValue)))
+ [^Number x] (. x (byteValue)))
(defn char
"Coerce to char"
@@ -2398,13 +2398,13 @@
"Returns the numerator part of a Ratio."
{:tag BigInteger}
[r]
- (.numerator #^clojure.lang.Ratio r))
+ (.numerator ^clojure.lang.Ratio r))
(defn denominator
"Returns the denominator part of a Ratio."
{:tag BigInteger}
[r]
- (.denominator #^clojure.lang.Ratio r))
+ (.denominator ^clojure.lang.Ratio r))
(defn decimal?
"Returns true if n is a BigDecimal"
@@ -2425,8 +2425,8 @@
{:tag BigInteger}
[x] (cond
(instance? BigInteger x) x
- (decimal? x) (.toBigInteger #^BigDecimal x)
- (ratio? x) (.bigIntegerValue #^clojure.lang.Ratio x)
+ (decimal? x) (.toBigInteger ^BigDecimal x)
+ (ratio? x) (.bigIntegerValue ^clojure.lang.Ratio x)
(number? x) (BigInteger/valueOf (long x))
:else (BigInteger. x)))
@@ -2437,11 +2437,11 @@
(decimal? x) x
(float? x) (. BigDecimal valueOf (double x))
(ratio? x) (/ (BigDecimal. (.numerator x)) (.denominator x))
- (instance? BigInteger x) (BigDecimal. #^BigInteger x)
+ (instance? BigInteger x) (BigDecimal. ^BigInteger x)
(number? x) (BigDecimal/valueOf (long x))
:else (BigDecimal. x)))
-(def #^{:private true} print-initialized false)
+(def ^{:private true} print-initialized false)
(defmulti print-method (fn [x writer] (type x)))
(defmulti print-dup (fn [x writer] (class x)))
@@ -2521,8 +2521,8 @@
"Reads the next line from stream that is the current value of *in* ."
[]
(if (instance? clojure.lang.LineNumberingPushbackReader *in*)
- (.readLine #^clojure.lang.LineNumberingPushbackReader *in*)
- (.readLine #^java.io.BufferedReader *in*)))
+ (.readLine ^clojure.lang.LineNumberingPushbackReader *in*)
+ (.readLine ^java.io.BufferedReader *in*)))
(defn read-string
"Reads one object from the string s"
@@ -2631,7 +2631,7 @@
(apply aset (aget array idx) idx2 idxv)))
(defmacro
- #^{:private true}
+ ^{:private true}
def-aset [name method coerce]
`(defn ~name
{:arglists '([~'array ~'idx ~'val] [~'array ~'idx ~'idx2 & ~'idxv])}
@@ -2642,35 +2642,35 @@
(apply ~name (aget array# idx#) idx2# idxv#))))
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of int. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of int. Returns val."}
aset-int setInt int)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of long. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of long. Returns val."}
aset-long setLong long)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of boolean. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of boolean. Returns val."}
aset-boolean setBoolean boolean)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of float. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of float. Returns val."}
aset-float setFloat float)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of double. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of double. Returns val."}
aset-double setDouble double)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of short. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of short. Returns val."}
aset-short setShort short)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of byte. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of byte. Returns val."}
aset-byte setByte byte)
(def-aset
- #^{:doc "Sets the value at the index/indices. Works on arrays of char. Returns val."}
+ ^{:doc "Sets the value at the index/indices. Works on arrays of char. Returns val."}
aset-char setChar char)
(defn make-array
@@ -2679,11 +2679,11 @@
Class objects can be obtained by using their imported or
fully-qualified name. Class objects for the primitive types can be
obtained using, e.g., Integer/TYPE."
- ([#^Class type len]
+ ([^Class type len]
(. Array (newInstance type (int len))))
- ([#^Class type dim & more-dims]
+ ([^Class type dim & more-dims]
(let [dims (cons dim more-dims)
- #^"[I" dimarray (make-array (. Integer TYPE) (count dims))]
+ ^"[I" dimarray (make-array (. Integer TYPE) (count dims))]
(dotimes [i (alength dimarray)]
(aset-int dimarray i (nth dims i)))
(. Array (newInstance type dimarray)))))
@@ -2693,7 +2693,7 @@
containing the contents of coll, which can be any Collection of any
Collection."
{:tag "[[Ljava.lang.Object;"}
- [#^java.util.Collection coll]
+ [^java.util.Collection coll]
(let [ret (make-array (. Class (forName "[Ljava.lang.Object;")) (. coll (size)))]
(loop [i 0 xs (seq coll)]
(when xs
@@ -2766,9 +2766,9 @@
(defn set
"Returns a set of the distinct elements of coll."
- [coll] (clojure.lang.PersistentHashSet/create #^clojure.lang.ISeq (seq coll)))
+ [coll] (clojure.lang.PersistentHashSet/create ^clojure.lang.ISeq (seq coll)))
-(defn #^{:private true}
+(defn ^{:private true}
filter-key [keyfn pred amap]
(loop [ret {} es (seq amap)]
(if es
@@ -2796,7 +2796,7 @@
"Returns a sequence of all namespaces."
[] (clojure.lang.Namespace/all))
-(defn #^clojure.lang.Namespace the-ns
+(defn ^clojure.lang.Namespace the-ns
"If passed a namespace, returns it. Else, when passed a symbol,
returns the namespace named by it, throwing an exception if not
found."
@@ -2828,7 +2828,7 @@
"Returns a map of the public intern mappings for the namespace."
[ns]
(let [ns (the-ns ns)]
- (filter-key val (fn [#^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
+ (filter-key val (fn [^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
(= ns (.ns v))
(.isPublic v)))
(ns-map ns))))
@@ -2871,7 +2871,7 @@
"Returns a map of the refer mappings for the namespace."
[ns]
(let [ns (the-ns ns)]
- (filter-key val (fn [#^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
+ (filter-key val (fn [^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
(not= ns (.ns v))))
(ns-map ns))))
@@ -2879,7 +2879,7 @@
"Returns a map of the intern mappings for the namespace."
[ns]
(let [ns (the-ns ns)]
- (filter-key val (fn [#^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
+ (filter-key val (fn [^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
(= ns (.ns v))))
(ns-map ns))))
@@ -2924,12 +2924,12 @@
(defn var-get
"Gets the value in the var object"
- [#^clojure.lang.Var x] (. x (get)))
+ [^clojure.lang.Var x] (. x (get)))
(defn var-set
"Sets the value in the var object to val. The var must be
thread-locally bound."
- [#^clojure.lang.Var x val] (. x (set val)))
+ [^clojure.lang.Var x val] (. x (set val)))
(defmacro with-local-vars
"varbinding=> symbol init-expr
@@ -3164,7 +3164,7 @@
(conj (pop groups) (conj (peek groups) [k v]))
(conj groups [k v])))
[] (partition 2 seq-exprs)))
- err (fn [& msg] (throw (IllegalArgumentException. #^String (apply str msg))))
+ err (fn [& msg] (throw (IllegalArgumentException. ^String (apply str msg))))
emit-bind (fn emit-bind [[[bind expr & mod-pairs]
& [[_ next-expr] :as next-groups]]]
(let [giter (gensym "iter__")
@@ -3309,7 +3309,7 @@
"Returns an instance of java.util.regex.Matcher, for use, e.g. in
re-find."
{:tag java.util.regex.Matcher}
- [#^java.util.regex.Pattern re s]
+ [^java.util.regex.Pattern re s]
(. re (matcher s)))
(defn re-groups
@@ -3317,7 +3317,7 @@
nested groups, returns a string of the entire match. If there are
nested groups, returns a vector of the groups, the first element
being the entire match."
- [#^java.util.regex.Matcher m]
+ [^java.util.regex.Matcher m]
(let [gc (. m (groupCount))]
(if (zero? gc)
(. m (group))
@@ -3330,7 +3330,7 @@
"Returns a lazy sequence of successive matches of pattern in string,
using java.util.regex.Matcher.find(), each such match processed with
re-groups."
- [#^java.util.regex.Pattern re s]
+ [^java.util.regex.Pattern re s]
(let [m (re-matcher re s)]
((fn step []
(when (. m (find))
@@ -3340,7 +3340,7 @@
"Returns the match, if any, of string to pattern, using
java.util.regex.Matcher.matches(). Uses re-groups to return the
groups."
- [#^java.util.regex.Pattern re s]
+ [^java.util.regex.Pattern re s]
(let [m (re-matcher re s)]
(when (. m (matches))
(re-groups m))))
@@ -3350,10 +3350,10 @@
"Returns the next regex match, if any, of string to pattern, using
java.util.regex.Matcher.find(). Uses re-groups to return the
groups."
- ([#^java.util.regex.Matcher m]
+ ([^java.util.regex.Matcher m]
(when (. m (find))
(re-groups m)))
- ([#^java.util.regex.Pattern re s]
+ ([^java.util.regex.Pattern re s]
(let [m (re-matcher re s)]
(re-find m))))
@@ -3452,8 +3452,8 @@
"A tree seq on java.io.Files"
[dir]
(tree-seq
- (fn [#^java.io.File f] (. f (isDirectory)))
- (fn [#^java.io.File d] (seq (. d (listFiles))))
+ (fn [^java.io.File f] (. f (isDirectory)))
+ (fn [^java.io.File d] (seq (. d (listFiles))))
dir))
(defn xml-seq
@@ -3477,7 +3477,7 @@
"Reads the file named by f using the encoding enc into a string
and returns it."
([f] (slurp f (.name (java.nio.charset.Charset/defaultCharset))))
- ([#^String f #^String enc]
+ ([^String f ^String enc]
(with-open [r (new java.io.BufferedReader
(new java.io.InputStreamReader
(new java.io.FileInputStream f) enc))]
@@ -3492,8 +3492,8 @@
(defn subs
"Returns the substring of s beginning at start inclusive, and ending
at end (defaults to length of string), exclusive."
- ([#^String s start] (. s (substring start)))
- ([#^String s start end] (. s (substring start end))))
+ ([^String s start] (. s (substring start)))
+ ([^String s start end] (. s (substring start end))))
(defn max-key
"Returns the x for which (k x), a number, is greatest."
@@ -3564,7 +3564,7 @@
(defn mk-bound-fn
{:private true}
- [#^clojure.lang.Sorted sc test key]
+ [^clojure.lang.Sorted sc test key]
(fn [e]
(test (.. sc comparator (compare (. sc entryKey e) key)) 0)))
@@ -3572,13 +3572,13 @@
"sc must be a sorted collection, test(s) one of <, <=, > or
>=. Returns a seq of those entries with keys ek for
which (test (.. sc comparator (compare ek key)) 0) is true"
- ([#^clojure.lang.Sorted sc test key]
+ ([^clojure.lang.Sorted sc test key]
(let [include (mk-bound-fn sc test key)]
(if (#{> >=} test)
(when-let [[e :as s] (. sc seqFrom key true)]
(if (include e) s (next s)))
(take-while include (. sc seq true)))))
- ([#^clojure.lang.Sorted sc start-test start-key end-test end-key]
+ ([^clojure.lang.Sorted sc start-test start-key end-test end-key]
(when-let [[e :as s] (. sc seqFrom start-key true)]
(take-while (mk-bound-fn sc end-test end-key)
(if ((mk-bound-fn sc start-test start-key) e) s (next s))))))
@@ -3587,13 +3587,13 @@
"sc must be a sorted collection, test(s) one of <, <=, > or
>=. Returns a reverse seq of those entries with keys ek for
which (test (.. sc comparator (compare ek key)) 0) is true"
- ([#^clojure.lang.Sorted sc test key]
+ ([^clojure.lang.Sorted sc test key]
(let [include (mk-bound-fn sc test key)]
(if (#{< <=} test)
(when-let [[e :as s] (. sc seqFrom key false)]
(if (include e) s (next s)))
(take-while include (. sc seq false)))))
- ([#^clojure.lang.Sorted sc start-test start-key end-test end-key]
+ ([^clojure.lang.Sorted sc start-test start-key end-test end-key]
(when-let [[e :as s] (. sc seqFrom end-key false)]
(take-while (mk-bound-fn sc start-test start-key)
(if ((mk-bound-fn sc end-test end-key) e) s (next s))))))
@@ -3639,7 +3639,7 @@
"Returns an empty collection of the same category as coll, or nil"
[coll]
(when (instance? clojure.lang.IPersistentCollection coll)
- (.empty #^clojure.lang.IPersistentCollection coll)))
+ (.empty ^clojure.lang.IPersistentCollection coll)))
(defmacro amap
"Maps an expression across an array a, using an index named idx, and
@@ -3772,7 +3772,7 @@
producer."
([s] (seque 100 s))
([n-or-q s]
- (let [#^BlockingQueue q (if (instance? BlockingQueue n-or-q)
+ (let [^BlockingQueue q (if (instance? BlockingQueue n-or-q)
n-or-q
(LinkedBlockingQueue. (int n-or-q)))
NIL (Object.) ;nil sentinel since LBQ doesn't support nils
@@ -3807,17 +3807,17 @@
(and (class? c)
(.isAssignableFrom java.lang.annotation.Annotation c)))
-(defn- is-runtime-annotation? [#^Class c]
+(defn- is-runtime-annotation? [^Class c]
(boolean
(and (is-annotation? c)
- (when-let [#^java.lang.annotation.Retention r
+ (when-let [^java.lang.annotation.Retention r
(.getAnnotation c java.lang.annotation.Retention)]
(= (.value r) java.lang.annotation.RetentionPolicy/RUNTIME)))))
-(defn- descriptor [#^Class c] (clojure.asm.Type/getDescriptor c))
+(defn- descriptor [^Class c] (clojure.asm.Type/getDescriptor c))
(declare process-annotation)
-(defn- add-annotation [#^clojure.asm.AnnotationVisitor av name v]
+(defn- add-annotation [^clojure.asm.AnnotationVisitor av name v]
(cond
(vector? v) (let [avec (.visitArray av name)]
(doseq [vval v]
@@ -3857,25 +3857,25 @@
(defn alter-var-root
"Atomically alters the root binding of var v by applying f to its
current value plus any args"
- [#^clojure.lang.Var v f & args] (.alterRoot v f args))
+ [^clojure.lang.Var v f & args] (.alterRoot v f args))
(defn bound?
"Returns true if all of the vars provided as arguments have any bound value, root or thread-local.
Implies that deref'ing the provided vars will succeed. Returns true if no vars are provided."
[& vars]
- (every? #(.isBound #^clojure.lang.Var %) vars))
+ (every? #(.isBound ^clojure.lang.Var %) vars))
(defn thread-bound?
"Returns true if all of the vars provided as arguments have thread-local bindings.
Implies that set!'ing the provided vars will succeed. Returns true if no vars are provided."
[& vars]
- (every? #(.getThreadBinding #^clojure.lang.Var %) vars))
+ (every? #(.getThreadBinding ^clojure.lang.Var %) vars))
(defn make-hierarchy
"Creates a hierarchy object for use with derive, isa? etc."
[] {:parents {} :descendants {} :ancestors {}})
-(def #^{:private true}
+(def ^{:private true}
global-hierarchy (make-hierarchy))
(defn not-empty
@@ -3884,7 +3884,7 @@
(defn bases
"Returns the immediate superclass and direct interfaces of c, if any"
- [#^Class c]
+ [^Class c]
(when c
(let [i (.getInterfaces c)
s (.getSuperclass c)]
@@ -3893,7 +3893,7 @@
(defn supers
"Returns the immediate and indirect superclasses and interfaces of c, if any"
- [#^Class class]
+ [^Class class]
(loop [ret (set (bases class)) cs ret]
(if (seq cs)
(let [c (first cs) bs (bases c)]
@@ -3910,7 +3910,7 @@
([h child parent]
(or (= child parent)
(and (class? parent) (class? child)
- (. #^Class parent isAssignableFrom child))
+ (. ^Class parent isAssignableFrom child))
(contains? ((:ancestors h) child) parent)
(and (class? child) (some #(contains? ((:ancestors h) %) parent) (supers child)))
(and (vector? parent) (vector? child)
@@ -4033,16 +4033,16 @@
(defn resultset-seq
"Creates and returns a lazy sequence of structmaps corresponding to
the rows in the java.sql.ResultSet rs"
- [#^java.sql.ResultSet rs]
+ [^java.sql.ResultSet rs]
(let [rsmeta (. rs (getMetaData))
idxs (range 1 (inc (. rsmeta (getColumnCount))))
- keys (map (comp keyword #(.toLowerCase #^String %))
+ keys (map (comp keyword #(.toLowerCase ^String %))
(map (fn [i] (. rsmeta (getColumnLabel i))) idxs))
check-keys
(or (apply distinct? keys)
(throw (Exception. "ResultSet must have unique column labels")))
row-struct (apply create-struct keys)
- row-values (fn [] (map (fn [#^Integer i] (. rs (getObject i))) idxs))
+ row-values (fn [] (map (fn [^Integer i] (. rs (getObject i))) idxs))
rows (fn thisfn []
(when (. rs (next))
(cons (apply struct row-struct (row-values)) (lazy-seq (thisfn)))))]
@@ -4076,7 +4076,7 @@
(defmacro with-loading-context [& body]
`((fn loading# []
(. clojure.lang.Var (pushThreadBindings {clojure.lang.Compiler/LOADER
- (.getClassLoader (.getClass #^Object loading#))}))
+ (.getClassLoader (.getClass ^Object loading#))}))
(try
~@body
(finally
@@ -4150,17 +4150,17 @@
;;;;;;;;;;; require/use/load, contributed by Stephen C. Gilardi ;;;;;;;;;;;;;;;;;;
(defonce
- #^{:private true
+ ^{:private true
:doc "A ref to a sorted set of symbols representing loaded libs"}
*loaded-libs* (ref (sorted-set)))
(defonce
- #^{:private true
+ ^{:private true
:doc "the set of paths currently being loaded by this thread"}
*pending-paths* #{})
(defonce
- #^{:private true :doc
+ ^{:private true :doc
"True while a verbose load is pending"}
*loading-verbosely* false)
@@ -4168,10 +4168,10 @@
"Throws an exception with a message if pred is true"
[pred fmt & args]
(when pred
- (let [#^String message (apply format fmt args)
+ (let [^String message (apply format fmt args)
exception (Exception. message)
raw-trace (.getStackTrace exception)
- boring? #(not= (.getMethodName #^StackTraceElement %) "doInvoke")
+ boring? #(not= (.getMethodName ^StackTraceElement %) "doInvoke")
trace (into-array (drop 2 (drop-while boring? raw-trace)))]
(.setStackTrace exception trace)
(throw exception))))
@@ -4374,8 +4374,8 @@
classpath-relative if it begins with a slash or relative to the root
directory for the current namespace otherwise."
[& paths]
- (doseq [#^String path paths]
- (let [#^String path (if (.startsWith path "/")
+ (doseq [^String path paths]
+ (let [^String path (if (.startsWith path "/")
path
(str (root-directory (ns-name *ns*)) \/ path))]
(when *loading-verbosely*
@@ -4475,19 +4475,19 @@
[coll] (instance? clojure.lang.Reversible coll))
(def
- #^{:doc "bound in a repl thread to the most recent value printed"}
+ ^{:doc "bound in a repl thread to the most recent value printed"}
*1)
(def
- #^{:doc "bound in a repl thread to the second most recent value printed"}
+ ^{:doc "bound in a repl thread to the second most recent value printed"}
*2)
(def
- #^{:doc "bound in a repl thread to the third most recent value printed"}
+ ^{:doc "bound in a repl thread to the third most recent value printed"}
*3)
(def
- #^{:doc "bound in a repl thread to the most recent exception caught by the repl"}
+ ^{:doc "bound in a repl thread to the most recent exception caught by the repl"}
*e)
(defn trampoline
@@ -4511,7 +4511,7 @@
ns (which can be a symbol or a namespace), setting its root binding
to val if supplied. The namespace must exist. The var will adopt any
metadata from the name symbol. Returns the var."
- ([ns #^clojure.lang.Symbol name]
+ ([ns ^clojure.lang.Symbol name]
(let [v (clojure.lang.Var/intern (the-ns ns) name)]
(when (meta name) (.setMeta v (meta name)))
v))
@@ -4668,7 +4668,7 @@
(defn future-done?
"Returns true if future f is done"
- [#^java.util.concurrent.Future f] (.isDone f))
+ [^java.util.concurrent.Future f] (.isDone f))
(defmacro letfn
@@ -4783,7 +4783,7 @@
invoke the function in another thread, and will cache the result and
return it on all subsequent calls to deref/@. If the computation has
not yet finished, calls to deref/@ will block."
- [#^Callable f]
+ [^Callable f]
(let [fut (.submit clojure.lang.Agent/soloExecutor f)]
(reify
clojure.lang.IDeref
@@ -4805,11 +4805,11 @@
(defn future-cancel
"Cancels the future, if possible."
- [#^java.util.concurrent.Future f] (.cancel f true))
+ [^java.util.concurrent.Future f] (.cancel f true))
(defn future-cancelled?
"Returns true if future f is cancelled"
- [#^java.util.concurrent.Future f] (.isCancelled f))
+ [^java.util.concurrent.Future f] (.isCancelled f))
(defn pmap
"Like map, except f is applied in parallel. Semi-lazy in that the
@@ -4852,9 +4852,9 @@
"clojure/version.properties")
properties (doto (new java.util.Properties) (.load version-stream))
prop (fn [k] (.getProperty properties (str "clojure.version." k)))
- clojure-version {:major (Integer/valueOf #^String (prop "major"))
- :minor (Integer/valueOf #^String (prop "minor"))
- :incremental (Integer/valueOf #^String (prop "incremental"))
+ clojure-version {:major (Integer/valueOf ^String (prop "major"))
+ :minor (Integer/valueOf ^String (prop "minor"))
+ :incremental (Integer/valueOf ^String (prop "incremental"))
:qualifier (prop "qualifier")}]
(def *clojure-version*
(if (not (= (prop "interim") "false"))
@@ -4912,7 +4912,7 @@
(defn transient
"Alpha - subject to change.
Returns a new, transient version of the collection, in constant time."
- [#^clojure.lang.IEditableCollection coll]
+ [^clojure.lang.IEditableCollection coll]
(.asTransient coll))
(defn persistent!
@@ -4920,14 +4920,14 @@
Returns a new, persistent version of the transient collection, in
constant time. The transient collection cannot be used after this
call, any such use will throw an exception."
- [#^clojure.lang.ITransientCollection coll]
+ [^clojure.lang.ITransientCollection coll]
(.persistent coll))
(defn conj!
"Alpha - subject to change.
Adds x to the transient collection, and return coll. The 'addition'
may happen at different 'places' depending on the concrete type."
- [#^clojure.lang.ITransientCollection coll x]
+ [^clojure.lang.ITransientCollection coll x]
(.conj coll x))
(defn assoc!
@@ -4935,8 +4935,8 @@
When applied to a transient map, adds mapping of key(s) to
val(s). When applied to a transient vector, sets the val at index.
Note - index must be <= (count vector). Returns coll."
- ([#^clojure.lang.ITransientAssociative coll key val] (.assoc coll key val))
- ([#^clojure.lang.ITransientAssociative coll key val & kvs]
+ ([^clojure.lang.ITransientAssociative coll key val] (.assoc coll key val))
+ ([^clojure.lang.ITransientAssociative coll key val & kvs]
(let [ret (.assoc coll key val)]
(if kvs
(recur ret (first kvs) (second kvs) (nnext kvs))
@@ -4945,8 +4945,8 @@
(defn dissoc!
"Alpha - subject to change.
Returns a transient map that doesn't contain a mapping for key(s)."
- ([#^clojure.lang.ITransientMap map key] (.without map key))
- ([#^clojure.lang.ITransientMap map key & ks]
+ ([^clojure.lang.ITransientMap map key] (.without map key))
+ ([^clojure.lang.ITransientMap map key & ks]
(let [ret (.without map key)]
(if ks
(recur ret (first ks) (next ks))
@@ -4956,7 +4956,7 @@
"Alpha - subject to change.
Removes the last item from a transient vector. If
the collection is empty, throws an exception. Returns coll"
- [#^clojure.lang.ITransientVector coll]
+ [^clojure.lang.ITransientVector coll]
(.pop coll))
(defn disj!
@@ -4964,7 +4964,7 @@
disj[oin]. Returns a transient set of the same (hashed/sorted) type, that
does not contain key(s)."
([set] set)
- ([#^clojure.lang.ITransientSet set key]
+ ([^clojure.lang.ITransientSet set key]
(. set (disjoin key)))
([set key & ks]
(let [ret (disj set key)]
diff --git a/src/clj/clojure/core/protocols.clj b/src/clj/clojure/core/protocols.clj
index 4184e91e..737345d1 100644
--- a/src/clj/clojure/core/protocols.clj
+++ b/src/clj/clojure/core/protocols.clj
@@ -42,7 +42,7 @@
clojure.lang.ArraySeq
(internal-reduce
[a-seq f val]
- (let [#^objects arr (.array a-seq)]
+ (let [^objects arr (.array a-seq)]
(loop [i (.index a-seq)
val val]
(if (< i (alength arr))
diff --git a/src/clj/clojure/core_deftype.clj b/src/clj/clojure/core_deftype.clj
index f2923279..84657847 100644
--- a/src/clj/clojure/core_deftype.clj
+++ b/src/clj/clojure/core_deftype.clj
@@ -112,18 +112,18 @@
((if (symbol? s) symbol str) (clojure.lang.Compiler/munge (str s))))
(defn- imap-cons
- [#^IPersistentMap this o]
+ [^IPersistentMap this o]
(cond
(instance? java.util.Map$Entry o)
- (let [#^java.util.Map$Entry pair o]
+ (let [^java.util.Map$Entry pair o]
(.assoc this (.getKey pair) (.getValue pair)))
(instance? clojure.lang.IPersistentVector o)
- (let [#^clojure.lang.IPersistentVector vec o]
+ (let [^clojure.lang.IPersistentVector vec o]
(.assoc this (.nth vec 0) (.nth vec 1)))
:else (loop [this this
o o]
(if (seq o)
- (let [#^java.util.Map$Entry pair (first o)]
+ (let [^java.util.Map$Entry pair (first o)]
(recur (.assoc this (.getKey pair) (.getValue pair)) (rest o)))
this))))
@@ -298,7 +298,7 @@
([~@fields] (new ~classname ~@fields nil nil))
([~@fields meta# extmap#] (new ~classname ~@fields meta# extmap#))))))
-(defn- print-defrecord [o #^Writer w]
+(defn- print-defrecord [o ^Writer w]
(print-meta o w)
(.write w "#:")
(.write w (.getName (class o)))
@@ -389,12 +389,12 @@
;;;;;;;;;;;;;;;;;;;;;;; protocols ;;;;;;;;;;;;;;;;;;;;;;;;
-(defn- expand-method-impl-cache [#^clojure.lang.MethodImplCache cache c f]
+(defn- expand-method-impl-cache [^clojure.lang.MethodImplCache cache c f]
(let [cs (into {} (remove (fn [[c e]] (nil? e)) (map vec (partition 2 (.table cache)))))
cs (assoc cs c (clojure.lang.MethodImplCache$Entry. c f))
[shift mask] (min-hash (keys cs))
table (make-array Object (* 2 (inc mask)))
- table (reduce (fn [#^objects t [c e]]
+ table (reduce (fn [^objects t [c e]]
(let [i (* 2 (int (shift-mask shift mask (hash c))))]
(aset t i c)
(aset t (inc i) e)
@@ -402,14 +402,14 @@
table cs)]
(clojure.lang.MethodImplCache. (.protocol cache) (.methodk cache) shift mask table)))
-(defn- super-chain [#^Class c]
+(defn- super-chain [^Class c]
(when c
(cons c (super-chain (.getSuperclass c)))))
(defn- pref
([] nil)
([a] a)
- ([#^Class a #^Class b]
+ ([^Class a ^Class b]
(if (.isAssignableFrom a b) b a)))
(defn find-protocol-impl [protocol x]
@@ -427,7 +427,7 @@
(get (find-protocol-impl protocol x) methodk))
(defn- implements? [protocol atype]
- (and atype (.isAssignableFrom #^Class (:on-interface protocol) atype)))
+ (and atype (.isAssignableFrom ^Class (:on-interface protocol) atype)))
(defn extends?
"Returns true if atype extends protocol"
@@ -445,7 +445,7 @@
[protocol x]
(boolean (find-protocol-impl protocol x)))
-(defn -cache-protocol-fn [#^clojure.lang.AFunction pf x #^Class c #^clojure.lang.IFn interf]
+(defn -cache-protocol-fn [^clojure.lang.AFunction pf x ^Class c ^clojure.lang.IFn interf]
(let [cache (.__methodImplCache pf)
f (if (.isInstance c x)
interf
@@ -471,7 +471,7 @@
`([~@gargs]
(. ~(with-meta target {:tag on-interface}) ~(or on-method method) ~@(rest gargs)))))
arglists))
- #^clojure.lang.AFunction f#
+ ^clojure.lang.AFunction f#
(fn ~gthis
~@(map
(fn [args]
@@ -488,7 +488,7 @@
f#))))
(defn -reset-methods [protocol]
- (doseq [[#^clojure.lang.Var v build] (:method-builders protocol)]
+ (doseq [[^clojure.lang.Var v build] (:method-builders protocol)]
(let [cache (clojure.lang.MethodImplCache. protocol (keyword (.sym v)))]
(.bindRoot v (build cache)))))
diff --git a/src/clj/clojure/core_print.clj b/src/clj/clojure/core_print.clj
index c0719711..22aa39eb 100644
--- a/src/clj/clojure/core_print.clj
+++ b/src/clj/clojure/core_print.clj
@@ -13,7 +13,7 @@
(import '(java.io Writer))
(def
- #^{:doc "*print-length* controls how many items of each collection the
+ ^{:doc "*print-length* controls how many items of each collection the
printer will print. If it is bound to logical false, there is no
limit. Otherwise, it must be bound to an integer indicating the maximum
number of items of each collection to print. If a collection contains
@@ -23,7 +23,7 @@
*print-length* nil)
(def
- #^{:doc "*print-level* controls how many levels deep the printer will
+ ^{:doc "*print-level* controls how many levels deep the printer will
print nested objects. If it is bound to logical false, there is no
limit. Otherwise, it must be bound to an integer indicating the maximum
level to print. Each argument to print is at level 0; if an argument is a
@@ -33,7 +33,7 @@
is nil indicating no limit."}
*print-level* nil)
-(defn- print-sequential [#^String begin, print-one, #^String sep, #^String end, sequence, #^Writer w]
+(defn- print-sequential [^String begin, print-one, ^String sep, ^String end, sequence, ^Writer w]
(binding [*print-level* (and (not *print-dup*) *print-level* (dec *print-level*))]
(if (and *print-level* (neg? *print-level*))
(.write w "#")
@@ -57,81 +57,81 @@
(recur xs)))))
(.write w end)))))
-(defn- print-meta [o, #^Writer w]
+(defn- print-meta [o, ^Writer w]
(when-let [m (meta o)]
(when (and (pos? (count m))
(or *print-dup*
(and *print-meta* *print-readably*)))
- (.write w "#^")
+ (.write w "^")
(if (and (= (count m) 1) (:tag m))
(pr-on (:tag m) w)
(pr-on m w))
(.write w " "))))
-(defmethod print-method :default [o, #^Writer w]
+(defmethod print-method :default [o, ^Writer w]
(print-method (vary-meta o #(dissoc % :type)) w))
-(defmethod print-method nil [o, #^Writer w]
+(defmethod print-method nil [o, ^Writer w]
(.write w "nil"))
(defmethod print-dup nil [o w] (print-method o w))
-(defn print-ctor [o print-args #^Writer w]
+(defn print-ctor [o print-args ^Writer w]
(.write w "#=(")
- (.write w (.getName #^Class (class o)))
+ (.write w (.getName ^Class (class o)))
(.write w ". ")
(print-args o w)
(.write w ")"))
-(defmethod print-method Object [o, #^Writer w]
+(defmethod print-method Object [o, ^Writer w]
(.write w "#<")
(.write w (.getSimpleName (class o)))
(.write w " ")
(.write w (str o))
(.write w ">"))
-(defmethod print-method clojure.lang.Keyword [o, #^Writer w]
+(defmethod print-method clojure.lang.Keyword [o, ^Writer w]
(.write w (str o)))
(defmethod print-dup clojure.lang.Keyword [o w] (print-method o w))
-(defmethod print-method Number [o, #^Writer w]
+(defmethod print-method Number [o, ^Writer w]
(.write w (str o)))
-(defmethod print-dup Number [o, #^Writer w]
+(defmethod print-dup Number [o, ^Writer w]
(print-ctor o
(fn [o w]
(print-dup (str o) w))
w))
-(defmethod print-dup clojure.lang.Fn [o, #^Writer w]
+(defmethod print-dup clojure.lang.Fn [o, ^Writer w]
(print-ctor o (fn [o w]) w))
(prefer-method print-dup clojure.lang.IPersistentCollection clojure.lang.Fn)
(prefer-method print-dup java.util.Map clojure.lang.Fn)
(prefer-method print-dup java.util.Collection clojure.lang.Fn)
-(defmethod print-method Boolean [o, #^Writer w]
+(defmethod print-method Boolean [o, ^Writer w]
(.write w (str o)))
(defmethod print-dup Boolean [o w] (print-method o w))
-(defn print-simple [o, #^Writer w]
+(defn print-simple [o, ^Writer w]
(print-meta o w)
(.write w (str o)))
-(defmethod print-method clojure.lang.Symbol [o, #^Writer w]
+(defmethod print-method clojure.lang.Symbol [o, ^Writer w]
(print-simple o w))
(defmethod print-dup clojure.lang.Symbol [o w] (print-method o w))
-(defmethod print-method clojure.lang.Var [o, #^Writer w]
+(defmethod print-method clojure.lang.Var [o, ^Writer w]
(print-simple o w))
-(defmethod print-dup clojure.lang.Var [#^clojure.lang.Var o, #^Writer w]
+(defmethod print-dup clojure.lang.Var [^clojure.lang.Var o, ^Writer w]
(.write w (str "#=(var " (.name (.ns o)) "/" (.sym o) ")")))
-(defmethod print-method clojure.lang.ISeq [o, #^Writer w]
+(defmethod print-method clojure.lang.ISeq [o, ^Writer w]
(print-meta o w)
(print-sequential "(" pr-on " " ")" o w))
@@ -144,20 +144,20 @@
-(defmethod print-dup java.util.Collection [o, #^Writer w]
+(defmethod print-dup java.util.Collection [o, ^Writer w]
(print-ctor o #(print-sequential "[" print-dup " " "]" %1 %2) w))
-(defmethod print-dup clojure.lang.IPersistentCollection [o, #^Writer w]
+(defmethod print-dup clojure.lang.IPersistentCollection [o, ^Writer w]
(print-meta o w)
(.write w "#=(")
- (.write w (.getName #^Class (class o)))
+ (.write w (.getName ^Class (class o)))
(.write w "/create ")
(print-sequential "[" print-dup " " "]" o w)
(.write w ")"))
(prefer-method print-dup clojure.lang.IPersistentCollection java.util.Collection)
-(def #^{:tag String
+(def ^{:tag String
:doc "Returns escape string for char or nil if none"}
char-escape-string
{\newline "\\n"
@@ -168,7 +168,7 @@
\formfeed "\\f"
\backspace "\\b"})
-(defmethod print-method String [#^String s, #^Writer w]
+(defmethod print-method String [^String s, ^Writer w]
(if (or *print-dup* *print-readably*)
(do (.append w \")
(dotimes [n (count s)]
@@ -181,27 +181,27 @@
(defmethod print-dup String [s w] (print-method s w))
-(defmethod print-method clojure.lang.IPersistentVector [v, #^Writer w]
+(defmethod print-method clojure.lang.IPersistentVector [v, ^Writer w]
(print-meta v w)
(print-sequential "[" pr-on " " "]" v w))
(defn- print-map [m print-one w]
(print-sequential
"{"
- (fn [e #^Writer w]
+ (fn [e ^Writer w]
(do (print-one (key e) w) (.append w \space) (print-one (val e) w)))
", "
"}"
(seq m) w))
-(defmethod print-method clojure.lang.IPersistentMap [m, #^Writer w]
+(defmethod print-method clojure.lang.IPersistentMap [m, ^Writer w]
(print-meta m w)
(print-map m pr-on w))
-(defmethod print-dup java.util.Map [m, #^Writer w]
+(defmethod print-dup java.util.Map [m, ^Writer w]
(print-ctor m #(print-map (seq %1) print-dup %2) w))
-(defmethod print-dup clojure.lang.IPersistentMap [m, #^Writer w]
+(defmethod print-dup clojure.lang.IPersistentMap [m, ^Writer w]
(print-meta m w)
(.write w "#=(")
(.write w (.getName (class m)))
@@ -211,11 +211,11 @@
(prefer-method print-dup clojure.lang.IPersistentCollection java.util.Map)
-(defmethod print-method clojure.lang.IPersistentSet [s, #^Writer w]
+(defmethod print-method clojure.lang.IPersistentSet [s, ^Writer w]
(print-meta s w)
(print-sequential "#{" pr-on " " "}" (seq s) w))
-(def #^{:tag String
+(def ^{:tag String
:doc "Returns name string for char or nil if none"}
char-name-string
{\newline "newline"
@@ -225,7 +225,7 @@
\formfeed "formfeed"
\return "return"})
-(defmethod print-method java.lang.Character [#^Character c, #^Writer w]
+(defmethod print-method java.lang.Character [^Character c, ^Writer w]
(if (or *print-dup* *print-readably*)
(do (.append w \\)
(let [n (char-name-string c)]
@@ -253,14 +253,14 @@
Byte/TYPE "Byte/TYPE"
Short/TYPE "Short/TYPE"})
-(defmethod print-method Class [#^Class c, #^Writer w]
+(defmethod print-method Class [^Class c, ^Writer w]
(.write w (.getName c)))
-(defmethod print-dup Class [#^Class c, #^Writer w]
+(defmethod print-dup Class [^Class c, ^Writer w]
(cond
(.isPrimitive c) (do
(.write w "#=(identity ")
- (.write w #^String (primitives-classnames c))
+ (.write w ^String (primitives-classnames c))
(.write w ")"))
(.isArray c) (do
(.write w "#=(java.lang.Class/forName \"")
@@ -270,17 +270,17 @@
(.write w "#=")
(.write w (.getName c)))))
-(defmethod print-method java.math.BigDecimal [b, #^Writer w]
+(defmethod print-method java.math.BigDecimal [b, ^Writer w]
(.write w (str b))
(.write w "M"))
-(defmethod print-method java.util.regex.Pattern [p #^Writer w]
+(defmethod print-method java.util.regex.Pattern [p ^Writer w]
(.write w "#\"")
- (loop [[#^Character c & r :as s] (seq (.pattern #^java.util.regex.Pattern p))
+ (loop [[^Character c & r :as s] (seq (.pattern ^java.util.regex.Pattern p))
qmode false]
(when s
(cond
- (= c \\) (let [[#^Character c2 & r2] r]
+ (= c \\) (let [[^Character c2 & r2] r]
(.append w \\)
(.append w c2)
(if qmode
@@ -296,14 +296,14 @@
(recur r qmode)))))
(.append w \"))
-(defmethod print-dup java.util.regex.Pattern [p #^Writer w] (print-method p w))
+(defmethod print-dup java.util.regex.Pattern [p ^Writer w] (print-method p w))
-(defmethod print-dup clojure.lang.Namespace [#^clojure.lang.Namespace n #^Writer w]
+(defmethod print-dup clojure.lang.Namespace [^clojure.lang.Namespace n ^Writer w]
(.write w "#=(find-ns ")
(print-dup (.name n) w)
(.write w ")"))
-(defmethod print-method clojure.lang.IDeref [o #^Writer w]
+(defmethod print-method clojure.lang.IDeref [o ^Writer w]
(print-sequential (format "#<%s@%x%s: "
(.getSimpleName (class o))
(System/identityHashCode o)
@@ -313,4 +313,4 @@
""))
pr-on, "", ">", (list (if (and (future? o) (not (future-done? o))) :pending @o)), w))
-(def #^{:private true} print-initialized true)
+(def ^{:private true} print-initialized true)
diff --git a/src/clj/clojure/core_proxy.clj b/src/clj/clojure/core_proxy.clj
index 9cbc39a6..ae130068 100644
--- a/src/clj/clojure/core_proxy.clj
+++ b/src/clj/clojure/core_proxy.clj
@@ -16,7 +16,7 @@
'(clojure.asm.commons Method GeneratorAdapter)
'(clojure.lang IProxy Reflector DynamicClassLoader IPersistentMap PersistentHashMap RT))
-(defn method-sig [#^java.lang.reflect.Method meth]
+(defn method-sig [^java.lang.reflect.Method meth]
[(. meth (getName)) (seq (. meth (getParameterTypes))) (. meth getReturnType)])
(defn- most-specific [rtypes]
@@ -33,37 +33,37 @@
(defn proxy-name
{:tag String}
- [#^Class super interfaces]
- (let [inames (into (sorted-set) (map #(.getName #^Class %) interfaces))]
+ [^Class super interfaces]
+ (let [inames (into (sorted-set) (map #(.getName ^Class %) interfaces))]
(apply str (.replace (str *ns*) \- \_) ".proxy"
(interleave (repeat "$")
(concat
[(.getName super)]
- (map #(subs % (inc (.lastIndexOf #^String % "."))) inames)
+ (map #(subs % (inc (.lastIndexOf ^String % "."))) inames)
[(Integer/toHexString (hash inames))])))))
-(defn- generate-proxy [#^Class super interfaces]
+(defn- generate-proxy [^Class super interfaces]
(let [cv (new ClassWriter (. ClassWriter COMPUTE_MAXS))
cname (.replace (proxy-name super interfaces) \. \/) ;(str "clojure/lang/" (gensym "Proxy__"))
ctype (. Type (getObjectType cname))
- iname (fn [#^Class c] (.. Type (getType c) (getInternalName)))
+ iname (fn [^Class c] (.. Type (getType c) (getInternalName)))
fmap "__clojureFnMap"
- totype (fn [#^Class c] (. Type (getType c)))
+ totype (fn [^Class c] (. Type (getType c)))
to-types (fn [cs] (if (pos? (count cs))
(into-array (map totype cs))
(make-array Type 0)))
- super-type #^Type (totype super)
- imap-type #^Type (totype IPersistentMap)
+ super-type ^Type (totype super)
+ imap-type ^Type (totype IPersistentMap)
ifn-type (totype clojure.lang.IFn)
obj-type (totype Object)
sym-type (totype clojure.lang.Symbol)
rt-type (totype clojure.lang.RT)
ex-type (totype java.lang.UnsupportedOperationException)
gen-bridge
- (fn [#^java.lang.reflect.Method meth #^java.lang.reflect.Method dest]
+ (fn [^java.lang.reflect.Method meth ^java.lang.reflect.Method dest]
(let [pclasses (. meth (getParameterTypes))
ptypes (to-types pclasses)
- rtype #^Type (totype (. meth (getReturnType)))
+ rtype ^Type (totype (. meth (getReturnType)))
m (new Method (. meth (getName)) rtype ptypes)
dtype (totype (.getDeclaringClass dest))
dm (new Method (. dest (getName)) (totype (. dest (getReturnType))) (to-types (. dest (getParameterTypes))))
@@ -78,10 +78,10 @@
(. gen (returnValue))
(. gen (endMethod))))
gen-method
- (fn [#^java.lang.reflect.Method meth else-gen]
+ (fn [^java.lang.reflect.Method meth else-gen]
(let [pclasses (. meth (getParameterTypes))
ptypes (to-types pclasses)
- rtype #^Type (totype (. meth (getReturnType)))
+ rtype ^Type (totype (. meth (getReturnType)))
m (new Method (. meth (getName)) rtype ptypes)
gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)
else-label (. gen (newLabel))
@@ -134,7 +134,7 @@
(. cv (visitField (+ (. Opcodes ACC_PRIVATE) (. Opcodes ACC_VOLATILE))
fmap (. imap-type (getDescriptor)) nil nil))
;add ctors matching/calling super's
- (doseq [#^Constructor ctor (. super (getDeclaredConstructors))]
+ (doseq [^Constructor ctor (. super (getDeclaredConstructors))]
(when-not (. Modifier (isPrivate (. ctor (getModifiers))))
(let [ptypes (to-types (. ctor (getParameterTypes)))
m (new Method "<init>" (. Type VOID_TYPE) ptypes)
@@ -192,7 +192,7 @@
(seq (. c (getDeclaredMethods)))
(seq (. c (getMethods))))]
(if (seq meths)
- (let [#^java.lang.reflect.Method meth (first meths)
+ (let [^java.lang.reflect.Method meth (first meths)
mods (. meth (getModifiers))
mk (method-sig meth)]
(if (or (considered mk)
@@ -207,7 +207,7 @@
(recur mm considered (. c (getSuperclass))))
[mm considered]))
ifaces-meths (into {}
- (for [#^Class iface interfaces meth (. iface (getMethods))
+ (for [^Class iface interfaces meth (. iface (getMethods))
:let [msig (method-sig meth)] :when (not (considered msig))]
{msig meth}))
mgroups (group-by-sig (concat mm ifaces-meths))
@@ -217,12 +217,12 @@
ifaces-meths (remove bridge? (vals ifaces-meths))
mm (remove bridge? (vals mm))]
;add methods matching supers', if no mapping -> call super
- (doseq [[#^java.lang.reflect.Method dest bridges] mb
- #^java.lang.reflect.Method meth bridges]
+ (doseq [[^java.lang.reflect.Method dest bridges] mb
+ ^java.lang.reflect.Method meth bridges]
(gen-bridge meth dest))
- (doseq [#^java.lang.reflect.Method meth mm]
+ (doseq [^java.lang.reflect.Method meth mm]
(gen-method meth
- (fn [#^GeneratorAdapter gen #^Method m]
+ (fn [^GeneratorAdapter gen ^Method m]
(. gen (loadThis))
;push args
(. gen (loadArgs))
@@ -233,9 +233,9 @@
(. m (getDescriptor)))))))
;add methods matching interfaces', if no mapping -> throw
- (doseq [#^java.lang.reflect.Method meth ifaces-meths]
+ (doseq [^java.lang.reflect.Method meth ifaces-meths]
(gen-method meth
- (fn [#^GeneratorAdapter gen #^Method m]
+ (fn [^GeneratorAdapter gen ^Method m]
(. gen (throwException ex-type (. m (getName))))))))
;finish class def
@@ -243,7 +243,7 @@
[cname (. cv toByteArray)]))
(defn- get-super-and-interfaces [bases]
- (if (. #^Class (first bases) (isInterface))
+ (if (. ^Class (first bases) (isInterface))
[Object bases]
[(first bases) (next bases)]))
@@ -258,7 +258,7 @@
pname (proxy-name super interfaces)]
(or (RT/loadClassForName pname)
(let [[cname bytecode] (generate-proxy super interfaces)]
- (. #^DynamicClassLoader (deref clojure.lang.Compiler/LOADER) (defineClass pname bytecode [super interfaces]))))))
+ (. ^DynamicClassLoader (deref clojure.lang.Compiler/LOADER) (defineClass pname bytecode [super interfaces]))))))
(defn construct-proxy
"Takes a proxy class and any arguments for its superclass ctor and
@@ -272,7 +272,7 @@
fns (which must take arguments matching the corresponding method,
plus an additional (explicit) first arg corresponding to this, and
sets the proxy's fn map."
- [#^IProxy proxy mappings]
+ [^IProxy proxy mappings]
(. proxy (__initClojureFnMappings mappings)))
(defn update-proxy
@@ -284,12 +284,12 @@
a fn, in which case the corresponding method will revert to the
default behavior. Note that this function can be used to update the
behavior of an existing instance without changing its identity."
- [#^IProxy proxy mappings]
+ [^IProxy proxy mappings]
(. proxy (__updateClojureFnMappings mappings)))
(defn proxy-mappings
"Takes a proxy instance and returns the proxy's fn map."
- [#^IProxy proxy]
+ [^IProxy proxy]
(. proxy (__getClojureFnMappings)))
(defmacro proxy
@@ -360,9 +360,9 @@
(defn bean
"Takes a Java object and returns a read-only implementation of the
map abstraction based upon its JavaBean properties."
- [#^Object x]
+ [^Object x]
(let [c (. x (getClass))
- pmap (reduce (fn [m #^java.beans.PropertyDescriptor pd]
+ pmap (reduce (fn [m ^java.beans.PropertyDescriptor pd]
(let [name (. pd (getName))
method (. pd (getReadMethod))]
(if (and method (zero? (alength (. method (getParameterTypes)))))
diff --git a/src/clj/clojure/genclass.clj b/src/clj/clojure/genclass.clj
index 4aeb4493..cdd02c5e 100644
--- a/src/clj/clojure/genclass.clj
+++ b/src/clj/clojure/genclass.clj
@@ -13,10 +13,10 @@
'(clojure.asm.commons Method GeneratorAdapter)
'(clojure.lang IPersistentMap))
-;(defn method-sig [#^java.lang.reflect.Method meth]
+;(defn method-sig [^java.lang.reflect.Method meth]
; [(. meth (getName)) (seq (. meth (getParameterTypes)))])
-(defn- non-private-methods [#^Class c]
+(defn- non-private-methods [^Class c]
(loop [mm {}
considered #{}
c c]
@@ -28,7 +28,7 @@
(seq (. c (getDeclaredMethods)))
(seq (. c (getMethods)))))]
(if meths
- (let [#^java.lang.reflect.Method meth (first meths)
+ (let [^java.lang.reflect.Method meth (first meths)
mods (. meth (getModifiers))
mk (method-sig meth)]
(if (or (considered mk)
@@ -43,12 +43,12 @@
(recur mm considered (. c (getSuperclass))))
mm)))
-(defn- ctor-sigs [#^Class super]
- (for [#^Constructor ctor (. super (getDeclaredConstructors))
+(defn- ctor-sigs [^Class super]
+ (for [^Constructor ctor (. super (getDeclaredConstructors))
:when (not (. Modifier (isPrivate (. ctor (getModifiers)))))]
(apply vector (. ctor (getParameterTypes)))))
-(defn- escape-class-name [#^Class c]
+(defn- escape-class-name [^Class c]
(.. (.getSimpleName c)
(replace "[]" "<>")))
@@ -58,18 +58,18 @@
(map escape-class-name pclasses)))
(str mname "-void")))
-(defn- #^java.lang.reflect.Field find-field [#^Class c f]
+(defn- ^java.lang.reflect.Field find-field [^Class c f]
(let [start-class c]
(loop [c c]
(if (= c Object)
(throw (new Exception (str "field, " f ", not defined in class, " start-class ", or its ancestors")))
(let [dflds (.getDeclaredFields c)
- rfld (first (filter #(= f (.getName #^java.lang.reflect.Field %)) dflds))]
+ rfld (first (filter #(= f (.getName ^java.lang.reflect.Field %)) dflds))]
(or rfld (recur (.getSuperclass c))))))))
;(distinct (map first(keys (mapcat non-private-methods [Object IPersistentMap]))))
-(def #^{:private true} prim->class
+(def ^{:private true} prim->class
{'int Integer/TYPE
'long Long/TYPE
'float Float/TYPE
@@ -80,7 +80,7 @@
'byte Byte/TYPE
'char Character/TYPE})
-(defn- #^Class the-class [x]
+(defn- ^Class the-class [x]
(cond
(class? x) x
(contains? prim->class x) (prim->class x)
@@ -106,16 +106,16 @@
impl-pkg-name (str impl-ns)
impl-cname (.. impl-pkg-name (replace "." "/") (replace \- \_))
ctype (. Type (getObjectType cname))
- iname (fn [#^Class c] (.. Type (getType c) (getInternalName)))
- totype (fn [#^Class c] (. Type (getType c)))
+ iname (fn [^Class c] (.. Type (getType c) (getInternalName)))
+ totype (fn [^Class c] (. Type (getType c)))
to-types (fn [cs] (if (pos? (count cs))
(into-array (map totype cs))
(make-array Type 0)))
- obj-type #^Type (totype Object)
+ obj-type ^Type (totype Object)
arg-types (fn [n] (if (pos? n)
(into-array (replicate n obj-type))
(make-array Type 0)))
- super-type #^Type (totype super)
+ super-type ^Type (totype super)
init-name (str init)
post-init-name (str post-init)
factory-name (str factory)
@@ -124,7 +124,7 @@
var-name (fn [s] (clojure.lang.Compiler/munge (str s "__var")))
class-type (totype Class)
rt-type (totype clojure.lang.RT)
- var-type #^Type (totype clojure.lang.Var)
+ var-type ^Type (totype clojure.lang.Var)
ifn-type (totype clojure.lang.IFn)
iseq-type (totype clojure.lang.ISeq)
ex-type (totype java.lang.UnsupportedOperationException)
@@ -139,7 +139,7 @@
(distinct (concat (keys sigs-by-name)
(mapcat (fn [[m s]] (map #(overload-name m (map the-class %)) s)) overloads)
(mapcat (comp (partial map str) vals val) exposes))))
- emit-get-var (fn [#^GeneratorAdapter gen v]
+ emit-get-var (fn [^GeneratorAdapter gen v]
(let [false-label (. gen newLabel)
end-label (. gen newLabel)]
(. gen getStatic ctype (var-name v) var-type)
@@ -152,7 +152,7 @@
(. gen pop)
(. gen visitInsn (. Opcodes ACONST_NULL))
(. gen mark end-label)))
- emit-unsupported (fn [#^GeneratorAdapter gen #^Method m]
+ emit-unsupported (fn [^GeneratorAdapter gen ^Method m]
(. gen (throwException ex-type (str (. m (getName)) " ("
impl-pkg-name "/" prefix (.getName m)
" not defined?)"))))
@@ -161,7 +161,7 @@
(let [pclasses (map the-class pclasses)
rclass (the-class rclass)
ptypes (to-types pclasses)
- rtype #^Type (totype rclass)
+ rtype ^Type (totype rclass)
m (new Method mname rtype ptypes)
is-overload (seq (overloads mname))
gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (if as-static (. Opcodes ACC_STATIC) 0))
@@ -359,9 +359,9 @@
;add methods matching supers', if no fn -> call super
(let [mm (non-private-methods super)]
- (doseq [#^java.lang.reflect.Method meth (vals mm)]
+ (doseq [^java.lang.reflect.Method meth (vals mm)]
(emit-forwarding-method (.getName meth) (.getParameterTypes meth) (.getReturnType meth) false
- (fn [#^GeneratorAdapter gen #^Method m]
+ (fn [^GeneratorAdapter gen ^Method m]
(. gen (loadThis))
;push args
(. gen (loadArgs))
@@ -371,20 +371,20 @@
(. m (getName))
(. m (getDescriptor)))))))
;add methods matching interfaces', if no fn -> throw
- (reduce (fn [mm #^java.lang.reflect.Method meth]
+ (reduce (fn [mm ^java.lang.reflect.Method meth]
(if (contains? mm (method-sig meth))
mm
(do
(emit-forwarding-method (.getName meth) (.getParameterTypes meth) (.getReturnType meth) false
emit-unsupported)
(assoc mm (method-sig meth) meth))))
- mm (mapcat #(.getMethods #^Class %) interfaces))
+ mm (mapcat #(.getMethods ^Class %) interfaces))
;extra methods
(doseq [[mname pclasses rclass :as msig] methods]
(emit-forwarding-method (str mname) pclasses rclass (:static (meta msig))
emit-unsupported))
;expose specified overridden superclass methods
- (doseq [[local-mname #^java.lang.reflect.Method m] (reduce (fn [ms [[name _ _] m]]
+ (doseq [[local-mname ^java.lang.reflect.Method m] (reduce (fn [ms [[name _ _] m]]
(if (contains? exposes-methods (symbol name))
(conj ms [((symbol name) exposes-methods) m])
ms)) [] (seq mm))]
@@ -532,7 +532,7 @@
The generated class automatically defines all of the non-private
methods of its superclasses/interfaces. This parameter can be used
to specify the signatures of additional methods of the generated
- class. Static methods can be specified with #^{:static true} in the
+ class. Static methods can be specified with ^{:static true} in the
signature's metadata. Do not repeat superclass/interface signatures
here.
@@ -596,7 +596,7 @@
;;;;;;;;;;;;;;;;;;;; gen-interface ;;;;;;;;;;;;;;;;;;;;;;
;; based on original contribution by Chris Houser
-(defn- #^Type asm-type
+(defn- ^Type asm-type
"Returns an asm Type object for c, which may be a primitive class
(such as Integer/TYPE), any other class (such as Double), or a
fully-qualified class name given as a string or symbol
@@ -666,7 +666,7 @@
[cname bytecode] (generate-interface options-map)]
(if *compile-files*
(clojure.lang.Compiler/writeClassFile cname bytecode)
- (.defineClass #^DynamicClassLoader (deref clojure.lang.Compiler/LOADER)
+ (.defineClass ^DynamicClassLoader (deref clojure.lang.Compiler/LOADER)
(str (:name options-map)) bytecode options))))
(comment
diff --git a/src/clj/clojure/gvec.clj b/src/clj/clojure/gvec.clj
index ff89aade..f9e65ba5 100644
--- a/src/clj/clojure/gvec.clj
+++ b/src/clj/clojure/gvec.clj
@@ -17,21 +17,21 @@
(def EMPTY-NODE (VecNode. nil (object-array 32)))
(definterface IVecImpl
- (#^int tailoff [])
- (arrayFor [#^int i])
- (pushTail [#^int level parent tailnode])
- (popTail [#^int level node])
- (newPath [edit #^int level node])
- (doAssoc [#^int level node #^int i val]))
+ (^int tailoff [])
+ (arrayFor [^int i])
+ (pushTail [^int level parent tailnode])
+ (popTail [^int level node])
+ (newPath [edit ^int level node])
+ (doAssoc [^int level node ^int i val]))
(definterface ArrayManager
- (array [#^int size])
- (#^int alength [arr])
+ (array [^int size])
+ (^int alength [arr])
(aclone [arr])
- (aget [arr #^int i])
- (aset [arr #^int i val]))
+ (aget [arr ^int i])
+ (aset [arr ^int i val]))
-(deftype ArrayChunk [#^clojure.core.ArrayManager am arr #^int off #^int end]
+(deftype ArrayChunk [^clojure.core.ArrayManager am arr ^int off ^int end]
clojure.lang.Indexed
(nth [_ i] (.aget am arr (+ off i)))
@@ -51,7 +51,7 @@
ret)))
)
-(deftype VecSeq [#^clojure.core.ArrayManager am #^clojure.core.IVecImpl vec anode #^int i #^int offset]
+(deftype VecSeq [^clojure.core.ArrayManager am ^clojure.core.IVecImpl vec anode ^int i ^int offset]
:no-print true
clojure.core.protocols.InternalReduce
@@ -119,7 +119,7 @@
(defmethod print-method ::VecSeq [v w]
((get (methods print-method) clojure.lang.ISeq) v w))
-(deftype Vec [#^clojure.core.ArrayManager am #^int cnt #^int shift root tail _meta]
+(deftype Vec [^clojure.core.ArrayManager am ^int cnt ^int shift root tail _meta]
Object
(equals [this o]
(cond
@@ -174,7 +174,7 @@
(let [tail-node (VecNode. (.edit root) tail)]
(if (> (bit-shift-right cnt (int 5)) (bit-shift-left (int 1) shift)) ;overflow root?
(let [new-root (VecNode. (.edit root) (object-array 32))]
- (doto #^objects (.arr new-root)
+ (doto ^objects (.arr new-root)
(aset 0 root)
(aset 1 (.newPath this (.edit root) shift tail-node)))
(new Vec am (inc cnt) (+ shift (int 5)) new-root (let [tl (.array am 1)] (.aset am tl 0 val) tl) (meta this)))
@@ -216,8 +216,8 @@
(cond
(nil? new-root)
(new Vec am (dec cnt) shift EMPTY-NODE new-tail (meta this))
- (and (> shift 5) (nil? (aget #^objects (.arr new-root) 1)))
- (new Vec am (dec cnt) (- shift 5) (aget #^objects (.arr new-root) 0) new-tail (meta this))
+ (and (> shift 5) (nil? (aget ^objects (.arr new-root) 1)))
+ (new Vec am (dec cnt) (- shift 5) (aget ^objects (.arr new-root) 0) new-tail (meta this))
:else
(new Vec am (dec cnt) shift new-root new-tail (meta this))))))
@@ -286,42 +286,42 @@
(loop [node root level shift]
(if (zero? level)
(.arr node)
- (recur (aget #^objects (.arr node) (bit-and (bit-shift-right i level) (int 0x1f)))
+ (recur (aget ^objects (.arr node) (bit-and (bit-shift-right i level) (int 0x1f)))
(- level (int 5))))))
(throw (IndexOutOfBoundsException.))))
(pushTail [this level parent tailnode]
(let [subidx (bit-and (bit-shift-right (dec cnt) level) (int 0x1f))
- ret (VecNode. (.edit parent) (aclone #^objects (.arr parent)))
+ ret (VecNode. (.edit parent) (aclone ^objects (.arr parent)))
node-to-insert (if (= level (int 5))
tailnode
- (let [child (aget #^objects (.arr parent) subidx)]
+ (let [child (aget ^objects (.arr parent) subidx)]
(if child
(.pushTail this (- level (int 5)) child tailnode)
(.newPath this (.edit root) (- level (int 5)) tailnode))))]
- (aset #^objects (.arr ret) subidx node-to-insert)
+ (aset ^objects (.arr ret) subidx node-to-insert)
ret))
(popTail [this level node]
(let [subidx (bit-and (bit-shift-right (- cnt 2) level) (int 0x1f))]
(cond
(> level 5)
- (let [new-child (.popTail this (- level 5) (aget #^objects (.arr node) subidx))]
+ (let [new-child (.popTail this (- level 5) (aget ^objects (.arr node) subidx))]
(if (and (nil? new-child) (zero? subidx))
nil
- (let [arr (aclone #^objects (.arr node))]
+ (let [arr (aclone ^objects (.arr node))]
(aset arr subidx new-child)
(VecNode. (.edit root) arr))))
(zero? subidx) nil
- :else (let [arr (aclone #^objects (.arr node))]
+ :else (let [arr (aclone ^objects (.arr node))]
(aset arr subidx nil)
(VecNode. (.edit root) arr)))))
- (newPath [this edit #^int level node]
+ (newPath [this edit ^int level node]
(if (zero? level)
node
(let [ret (VecNode. edit (object-array 32))]
- (aset #^objects (.arr ret) 0 (.newPath this edit (- level (int 5)) node))
+ (aset ^objects (.arr ret) 0 (.newPath this edit (- level (int 5)) node))
ret)))
(doAssoc [this level node i val]
@@ -330,7 +330,7 @@
(let [arr (.aclone am (.arr node))]
(.aset am arr (bit-and i (int 0x1f)) val)
(VecNode. (.edit node) arr))
- (let [arr (aclone #^objects (.arr node))
+ (let [arr (aclone ^objects (.arr node))
subidx (bit-and (bit-shift-right i level) (int 0x1f))]
(aset arr subidx (.doAssoc this (- level (int 5)) (aget arr subidx) i val))
(VecNode. (.edit node) arr))))
@@ -359,7 +359,7 @@
(add [_ o] (throw (UnsupportedOperationException.)))
(addAll [_ c] (throw (UnsupportedOperationException.)))
(clear [_] (throw (UnsupportedOperationException.)))
- (#^boolean remove [_ o] (throw (UnsupportedOperationException.)))
+ (^boolean remove [_ o] (throw (UnsupportedOperationException.)))
(removeAll [_ c] (throw (UnsupportedOperationException.)))
(retainAll [_ c] (throw (UnsupportedOperationException.)))
@@ -393,7 +393,7 @@
(subList [this a z] (subvec this a z))
(add [_ i o] (throw (UnsupportedOperationException.)))
(addAll [_ i c] (throw (UnsupportedOperationException.)))
- (#^Object remove [_ #^int i] (throw (UnsupportedOperationException.)))
+ (^Object remove [_ ^int i] (throw (UnsupportedOperationException.)))
(set [_ i e] (throw (UnsupportedOperationException.)))
)
@@ -410,7 +410,7 @@
(aget [_ ~garr i#] (aget ~tgarr i#))
(aset [_ ~garr i# val#] (aset ~tgarr i# (~t val#))))))
-(def #^{:private true} ams
+(def ^{:private true} ams
{:int (mk-am int)
:long (mk-am long)
:float (mk-am float)
@@ -426,5 +426,5 @@
resulting vector complies with the interface of vectors in general,
but stores the values unboxed internally."
[t]
- (let [am #^clojure.core.ArrayManager (ams t)]
+ (let [am ^clojure.core.ArrayManager (ams t)]
(Vec. am 0 5 EMPTY-NODE (.array am 0) nil)))
diff --git a/src/clj/clojure/inspector.clj b/src/clj/clojure/inspector.clj
index d7f8f30f..d28d1ea8 100644
--- a/src/clj/clojure/inspector.clj
+++ b/src/clj/clojure/inspector.clj
@@ -6,7 +6,7 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(ns #^{:doc "Graphical object inspector for Clojure data structures."
+(ns ^{:doc "Graphical object inspector for Clojure data structures."
:author "Rich Hickey"}
clojure.inspector
(:import
diff --git a/src/clj/clojure/main.clj b/src/clj/clojure/main.clj
index c715ea8d..bc4ac2c0 100644
--- a/src/clj/clojure/main.clj
+++ b/src/clj/clojure/main.clj
@@ -8,7 +8,7 @@
;; Originally contributed by Stephen C. Gilardi
-(ns #^{:doc "Top-level main function for Clojure REPL and scripts."
+(ns ^{:doc "Top-level main function for Clojure REPL and scripts."
:author "Stephen C. Gilardi and Rich Hickey"}
clojure.main
(:refer-clojure :exclude [with-bindings])
@@ -96,7 +96,7 @@
(defn- root-cause
"Returns the initial cause of an exception or error by peeling off all of
its wrappers"
- [#^Throwable throwable]
+ [^Throwable throwable]
(loop [cause throwable]
(if-let [cause (.getCause cause)]
(recur cause)
@@ -164,7 +164,7 @@
(let [{:keys [init need-prompt prompt flush read eval print caught]
:or {init #()
need-prompt (if (instance? LineNumberingPushbackReader *in*)
- #(.atLineStart #^LineNumberingPushbackReader *in*)
+ #(.atLineStart ^LineNumberingPushbackReader *in*)
#(identity true))
prompt repl-prompt
flush flush
@@ -206,7 +206,7 @@
(defn load-script
"Loads Clojure source from a file or resource given its path. Paths
beginning with @ or @/ are considered relative to classpath."
- [#^String path]
+ [^String path]
(if (.startsWith path "@")
(RT/loadResourceScript
(.substring path (if (.startsWith path "@/") 2 1)))
diff --git a/src/clj/clojure/parallel.clj b/src/clj/clojure/parallel.clj
index 9b2f3b87..29b01e21 100644
--- a/src/clj/clojure/parallel.clj
+++ b/src/clj/clojure/parallel.clj
@@ -6,7 +6,7 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(ns #^{:doc "DEPRECATED Wrapper of the ForkJoin library (JSR-166)."
+(ns ^{:doc "DEPRECATED Wrapper of the ForkJoin library (JSR-166)."
:author "Rich Hickey"}
clojure.parallel)
(alias 'parallel 'clojure.parallel)
diff --git a/src/clj/clojure/set.clj b/src/clj/clojure/set.clj
index 0cb4b49d..dbfcd194 100644
--- a/src/clj/clojure/set.clj
+++ b/src/clj/clojure/set.clj
@@ -6,7 +6,7 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(ns #^{:doc "Set operations such as union/intersection."
+(ns ^{:doc "Set operations such as union/intersection."
:author "Rich Hickey"}
clojure.set)
diff --git a/src/clj/clojure/stacktrace.clj b/src/clj/clojure/stacktrace.clj
index ebe00aac..c69bdc68 100644
--- a/src/clj/clojure/stacktrace.clj
+++ b/src/clj/clojure/stacktrace.clj
@@ -11,7 +11,7 @@
;; by Stuart Sierra
;; January 6, 2009
-(ns #^{:doc "Print stack traces oriented towards Clojure, not Java."
+(ns ^{:doc "Print stack traces oriented towards Clojure, not Java."
:author "Stuart Sierra"}
clojure.stacktrace)
diff --git a/src/clj/clojure/template.clj b/src/clj/clojure/template.clj
index f84e602a..b4879564 100644
--- a/src/clj/clojure/template.clj
+++ b/src/clj/clojure/template.clj
@@ -22,7 +22,7 @@
;; December 15, 2008: first version
-(ns #^{:doc "Macros that expand to repeated copies of a template expression."
+(ns ^{:doc "Macros that expand to repeated copies of a template expression."
:author "Stuart Sierra"}
clojure.template
(:require [clojure.walk :as walk]))
diff --git a/src/clj/clojure/test.clj b/src/clj/clojure/test.clj
index 51d5e3c3..5317745b 100644
--- a/src/clj/clojure/test.clj
+++ b/src/clj/clojure/test.clj
@@ -15,7 +15,7 @@
;; contributions and suggestions.
(ns
- #^{:author "Stuart Sierra, with contributions and suggestions by
+ ^{:author "Stuart Sierra, with contributions and suggestions by
Chas Emerick, Allen Rohner, and Stuart Halloway",
:doc "A unit testing framework.
@@ -237,13 +237,13 @@
;;; USER-MODIFIABLE GLOBALS
(defonce
- #^{:doc "True by default. If set to false, no test functions will
+ ^{:doc "True by default. If set to false, no test functions will
be created by deftest, set-test, or with-test. Use this to omit
tests when compiling or loading production code."}
*load-tests* true)
(def
- #^{:doc "The maximum depth of stack traces to print when an Exception
+ ^{:doc "The maximum depth of stack traces to print when an Exception
is thrown during a test. Defaults to nil, which means print the
complete stack trace."}
*stack-trace-depth* nil)
@@ -276,7 +276,7 @@
"Returns a vector [filename line-number] for the nth call up the
stack."
[n]
- (let [#^StackTraceElement s (nth (.getStackTrace (new java.lang.Throwable)) n)]
+ (let [^StackTraceElement s (nth (.getStackTrace (new java.lang.Throwable)) n)]
[(.getFileName s) (.getLineNumber s)]))
(defn testing-vars-str
@@ -310,7 +310,7 @@
;;; TEST RESULT REPORTING
(defmulti
- #^{:doc "Generic reporting function, may be overridden to plug in
+ ^{:doc "Generic reporting function, may be overridden to plug in
different report formats (e.g., TAP, JUnit). Assertions such as
'is' call 'report' to indicate results. The argument given to
'report' will be a map with a :type key. See the documentation at
@@ -633,7 +633,7 @@
;;; RUNNING TESTS: LOW-LEVEL FUNCTIONS
-(defn #^{:dynamic true} test-var
+(defn ^{:dynamic true} test-var
"If v has a function in its :test metadata, calls that function,
with *testing-vars* bound to (conj *testing-vars* v)."
[v]
diff --git a/src/clj/clojure/test/junit.clj b/src/clj/clojure/test/junit.clj
index a9844afb..b25c4332 100644
--- a/src/clj/clojure/test/junit.clj
+++ b/src/clj/clojure/test/junit.clj
@@ -14,7 +14,7 @@
;; DOCUMENTATION
;;
-(ns #^{:doc "clojure.test extension for JUnit-compatible XML output.
+(ns ^{:doc "clojure.test extension for JUnit-compatible XML output.
JUnit (http://junit.org/) is the most popular unit-testing library
for Java. As such, tool support for JUnit output formats is
@@ -39,7 +39,7 @@
[clojure.test :as t]))
;; copied from clojure.contrib.lazy-xml
-(def #^{:private true}
+(def ^{:private true}
escape-xml-map
(zipmap "'<>\"&" (map #(str \& % \;) '[apos lt gt quot amp])))
(defn- escape-xml [text]
diff --git a/src/clj/clojure/test/tap.clj b/src/clj/clojure/test/tap.clj
index 3e41f878..8b2ec972 100644
--- a/src/clj/clojure/test/tap.clj
+++ b/src/clj/clojure/test/tap.clj
@@ -20,7 +20,7 @@
-(ns #^{:doc "clojure.test extensions for the Test Anything Protocol (TAP)
+(ns ^{:doc "clojure.test extensions for the Test Anything Protocol (TAP)
TAP is a simple text-based syntax for reporting test results. TAP
was originally develped for Perl, and now has implementations in
@@ -51,7 +51,7 @@
"Prints a TAP diagnostic line. data is a (possibly multi-line)
string."
[data]
- (doseq [line (.split #^String data "\n")]
+ (doseq [line (.split ^String data "\n")]
(println "#" line)))
(defn print-tap-pass
diff --git a/src/clj/clojure/walk.clj b/src/clj/clojure/walk.clj
index b025705f..70094d07 100644
--- a/src/clj/clojure/walk.clj
+++ b/src/clj/clojure/walk.clj
@@ -19,7 +19,7 @@
(ns
- #^{:author "Stuart Sierra",
+ ^{:author "Stuart Sierra",
:doc "This file defines a generic tree walker for Clojure data
structures. It takes any data structure (list, vector, map, set,
seq), calls a function on every element, and uses the return value
diff --git a/src/clj/clojure/xml.clj b/src/clj/clojure/xml.clj
index ba14d4c7..7df67bfa 100644
--- a/src/clj/clojure/xml.clj
+++ b/src/clj/clojure/xml.clj
@@ -6,7 +6,7 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(ns #^{:doc "XML reading/writing."
+(ns ^{:doc "XML reading/writing."
:author "Rich Hickey"}
clojure.xml
(:import (org.xml.sax ContentHandler Attributes SAXException)
@@ -32,7 +32,7 @@
(set! *current* (push-content *current* (str *sb*)))))]
(new clojure.lang.XMLHandler
(proxy [ContentHandler] []
- (startElement [uri local-name q-name #^Attributes atts]
+ (startElement [uri local-name q-name ^Attributes atts]
(let [attrs (fn [ret i]
(if (neg? i)
ret
@@ -55,10 +55,10 @@
(set! *stack* (pop *stack*))
(set! *state* :between)
nil)
- (characters [#^chars ch start length]
+ (characters [^chars ch start length]
(when-not (= *state* :chars)
(set! *sb* (new StringBuilder)))
- (let [#^StringBuilder sb *sb*]
+ (let [^StringBuilder sb *sb*]
(.append sb ch (int start) (int length))
(set! *state* :chars))
nil)
diff --git a/src/clj/clojure/zip.clj b/src/clj/clojure/zip.clj
index 8896812b..74797ad8 100644
--- a/src/clj/clojure/zip.clj
+++ b/src/clj/clojure/zip.clj
@@ -9,7 +9,7 @@
;functional hierarchical zipper, with navigation, editing and enumeration
;see Huet
-(ns #^{:doc "Functional hierarchical zipper, with navigation, editing,
+(ns ^{:doc "Functional hierarchical zipper, with navigation, editing,
and enumeration. See Huet"
:author "Rich Hickey"}
clojure.zip
@@ -28,7 +28,7 @@
children, returns a new branch node with the supplied children.
root is the root node."
[branch? children make-node root]
- #^{:zip/branch? branch? :zip/children children :zip/make-node make-node}
+ ^{:zip/branch? branch? :zip/children children :zip/make-node make-node}
[root nil])
(defn seq-zip