Permalink
Browse files

replace #^s with ^s

  • Loading branch information...
1 parent a5ca824 commit 787938361128c2bc21ed896dd4523651b59cb420 @richhickey richhickey committed Apr 26, 2010
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -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))
@@ -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,27 +389,27 @@
;;;;;;;;;;;;;;;;;;;;;;; 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)
t))
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)))))
@@ -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)
Oops, something went wrong.

0 comments on commit 7879383

Please sign in to comment.