Skip to content

Commit

Permalink
Changed all instances of ^x across contrib to (meta x) since the ^x f…
Browse files Browse the repository at this point in the history
…orm is being deprecated in 1.1

refs #48
  • Loading branch information
tomfaulhaber committed Dec 11, 2009
1 parent eb73c54 commit e5b7819
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions clojurescript/src/clojure/contrib/clojurescript.clj
Expand Up @@ -147,7 +147,7 @@
n)))

(defn- var-parts [e]
(let [{:keys [name ns]} ^(.var e)]
(let [{:keys [name ns]} (meta (.var e))]
[(Compiler/munge (str (.getName ns))) (var-munge name)]))

(defmethod tojs clojure.lang.Compiler$UnresolvedVarExpr [e ctx]
Expand Down Expand Up @@ -318,7 +318,7 @@
(eval f)
nil)
(when-not (or (and (instance? Compiler$DefExpr mainexpr)
(skip-def (:name ^(.var mainexpr))))
(skip-def (:name (meta (.var mainexpr)))))
(and (instance? Compiler$InstanceMethodExpr mainexpr)
(or (= "setMacro" (.methodName mainexpr))
(and (= "addMethod" (.methodName mainexpr))
Expand Down
6 changes: 3 additions & 3 deletions src/clojure/contrib/condition.clj
Expand Up @@ -94,8 +94,8 @@ http://groups.google.com/group/clojure/browse_frm/thread/da1285c538f22bb5"}
~@code
(catch Condition c#
(binding [*condition-object* c#
*condition* ^c#
*selector* (~dispatch-fn ^c#)]
*condition* (meta c#)
*selector* (~dispatch-fn (meta c#))]
(cond
~@(mapcat
(fn [[_ key & body]]
Expand All @@ -117,7 +117,7 @@ http://groups.google.com/group/clojure/browse_frm/thread/da1285c538f22bb5"}

(defmethod stack-trace-info Condition
[condition]
(stack-trace-info ^condition))
(stack-trace-info (meta condition)))

(defmethod stack-trace-info Throwable
[throwable]
Expand Down
4 changes: 2 additions & 2 deletions src/clojure/contrib/error_kit.clj
Expand Up @@ -54,7 +54,7 @@ or API adjustments."}
(defn- qualify-sym [sym]
(let [v (resolve sym)]
(assert v)
(apply symbol (map #(str (% ^v)) [:ns :name]))))
(apply symbol (map #(str (% (meta v))) [:ns :name]))))

(defmacro deferror
"Define a new error type"
Expand Down Expand Up @@ -110,7 +110,7 @@ or API adjustments."}
(defmacro raise
"Raise an error of the type err-name, constructed with the given args"
[err-name & args]
`(raise* (~err-name ~(zipmap (::args ^(resolve err-name))
`(raise* (~err-name ~(zipmap (::args (meta (resolve err-name)))
args))))

; It'd be nice to assert that these are used in a tail position of a handler
Expand Down
2 changes: 1 addition & 1 deletion src/clojure/contrib/pprint/examples/show_doc.clj
Expand Up @@ -37,7 +37,7 @@
#(vector (ns-name %)
(map
(fn [f]
(let [f-meta ^(find-var (symbol (str (ns-name %)) (str f)))]
(let [f-meta (meta (find-var (symbol (str (ns-name %)) (str f))))]
[f (:arglists f-meta) (:doc f-meta)]))
(filter
(fn [a] (instance? clojure.lang.IFn a))
Expand Down
2 changes: 1 addition & 1 deletion src/clojure/contrib/repl_utils.clj
Expand Up @@ -107,7 +107,7 @@
(when-let [filepath (:file (meta v))]
(when-let [strm (.getResourceAsStream (RT/baseLoader) filepath)]
(with-open [rdr (LineNumberReader. (InputStreamReader. strm))]
(dotimes [_ (dec (:line ^v))] (.readLine rdr))
(dotimes [_ (dec (:line (meta v)))] (.readLine rdr))
(let [text (StringBuilder.)
pbr (proxy [PushbackReader] [rdr]
(read [] (let [i (proxy-super read)]
Expand Down
2 changes: 1 addition & 1 deletion src/clojure/contrib/types.clj
Expand Up @@ -49,7 +49,7 @@
(defmethod constructor-form :default
[o] nil)
(defmethod constructor-form ::type
[o] (cons (::constructor ^o) (deconstruct o)))
[o] (cons (::constructor (meta o)) (deconstruct o)))

(defmacro deftype
"Define a data type by a type tag (a namespace-qualified keyword)
Expand Down
8 changes: 4 additions & 4 deletions src/clojure/contrib/zip_filter.clj
Expand Up @@ -21,10 +21,10 @@ general, and xml trees in particular.
; This uses the negative form (no-auto) so that the result from any
; naive function, including user functions, defaults to "auto".
(defn auto
[v x] (with-meta x ((if v dissoc assoc) ^x :zip-filter/no-auto? true)))
[v x] (with-meta x ((if v dissoc assoc) (meta x) :zip-filter/no-auto? true)))

(defn auto?
[x] (not (:zip-filter/no-auto? ^x)))
[x] (not (:zip-filter/no-auto? (meta x))))

(defn right-locs
"Returns a lazy sequence of locations to the right of loc, starting with loc."
Expand Down Expand Up @@ -74,7 +74,7 @@ general, and xml trees in particular.
#^{:private true}
[pred loc]
(let [rtn (pred loc)]
(cond (and (map? ^rtn) (:zip-filter/is-node? ^rtn)) (list rtn)
(cond (and (map? (meta rtn)) (:zip-filter/is-node? (meta rtn))) (list rtn)
(= rtn true) (list loc)
(= rtn false) nil
(nil? rtn) nil
Expand All @@ -86,7 +86,7 @@ general, and xml trees in particular.
[loc preds mkpred]
(reduce (fn [prevseq expr]
(mapcat #(fixup-apply (or (mkpred expr) expr) %) prevseq))
(list (with-meta loc (assoc ^loc :zip-filter/is-node? true)))
(list (with-meta loc (assoc (meta loc) :zip-filter/is-node? true)))
preds))

; see clojure.contrib.zip-filter.xml for examples

0 comments on commit e5b7819

Please sign in to comment.