Permalink
Browse files

Rename namespaces to remove non-portable "clr" name.

  • Loading branch information...
1 parent 211a69e commit cdf79ad0a05ec0f19d927ba7226890e11d283895 @frenchy64 frenchy64 committed Mar 22, 2013
@@ -1,14 +1,14 @@
(set! *warn-on-reflection* true)
-(ns clojure.clr.tools.analyzer
+(ns clojure.tools.analyzer
"Interface to Compiler's analyze.
Entry point `analyze-path` and `analyze-one`"
(:require [clojure.reflect :as reflect]
[clojure.clr.io :as io]
[clojure.repl :as repl]
[clojure.string :as string]
[clojure.set :as set]
- [clojure.clr.tools.analyzer.util])
+ [clojure.tools.analyzer.util])
(:import (System.IO TextReader)
(System.Reflection BindingFlags)
(clojure.lang RT Compiler LineNumberingTextReader)
@@ -1,5 +1,5 @@
-(ns clojure.clr.tools.analyzer.emit-form
- (:require [clojure.clr.tools.analyzer :refer [ast]]))
+(ns clojure.tools.analyzer.emit-form
+ (:require [clojure.tools.analyzer :refer [ast]]))
(def emit-default ::emit-default)
@@ -24,13 +24,13 @@
(defmethod map->form [:keyword emit-default] [{:keys [val]} _] val)
(defmethod map->form [:static-method emit-default]
- [{:keys [class method-name args]} mode]
- `(~(symbol (.getName class) (str method-name))
+ [{:keys [^Type class method-name args]} mode]
+ `(~(symbol (.Name class) (str method-name))
~@(map #(map->form % mode) args)))
(defmethod map->form [:static-field emit-default]
- [{:keys [class field-name]} _]
- (symbol (.getName class) (str field-name)))
+ [{:keys [^Type class field-name]} _]
+ (symbol (.Name class) (str field-name)))
(defmethod map->form [:invoke emit-default]
[{:keys [fexpr args]} mode]
@@ -55,8 +55,8 @@
~@(map #(map->form % mode) args)))
(defmethod map->form [:new emit-default]
- [{:keys [class args]} mode]
- `(new ~(symbol (.getName class))
+ [{:keys [^Type class args]} mode]
+ `(new ~(symbol (.Name class))
~@(map #(map->form % mode) args)))
(defmethod map->form [:empty-expr emit-default] [{:keys [coll]} _] coll)
@@ -117,8 +117,8 @@
`(if ~@(map #(map->form % mode) [test then else])))
(defmethod map->form [:instance-of emit-default]
- [{:keys [class the-expr]} mode]
- `(clojure.core/instance? ~(symbol (.getName class))
+ [{:keys [^Type class the-expr]} mode]
+ `(clojure.core/instance? ~(symbol (.Name class))
~(map->form the-expr mode)))
(defmethod map->form [:def emit-default]
@@ -164,8 +164,8 @@
(when finally-expr [(list 'finally (map->form finally-expr mode))]))))
(defmethod map->form [:catch emit-default]
- [{:keys [class local-binding handler]} mode]
- (list 'catch (symbol (.getName class))
+ [{:keys [^Type class local-binding handler]} mode]
+ (list 'catch (symbol (.Name class))
(map->form local-binding mode)
(map->form handler mode)))
@@ -186,6 +186,9 @@
test-type
skip-check))
+(defmethod map->form [:host-arg emit-default]
+ [{:keys [expr]} mode]
+ (map->form expr))
(comment
(defmacro frm [f]
@@ -1,7 +1,7 @@
-(ns clojure.clr.tools.analyzer.examples.docstring
+(ns clojure.tools.analyzer.examples.docstring
"Warns on suspected misplaced docstrings in function definitions.
Entry point `find-and-check-defs`"
- (:require [clojure.clr.tools.analyzer :as analyze]))
+ (:require [clojure.tools.analyzer :as analyze]))
(defn check-def [exp]
(when (= :fn-expr (-> exp :init :op))
@@ -1,5 +1,5 @@
-(ns clojure.clr.tools.analyzer.examples.dynvars
- (:require [clojure.clr.tools.analyzer :as analyze]))
+(ns clojure.tools.analyzer.examples.dynvars
+ (:require [clojure.tools.analyzer :as analyze]))
(defn earmuffed? [sym]
(let [s (name sym)]
@@ -1,6 +1,6 @@
-(ns clojure.clr.tools.analyzer.examples.load-core
+(ns clojure.tools.analyzer.examples.load-core
(:import [clojure.lang Compiler RT DynamicClassLoader])
- (:require [clojure.clr.tools.analyzer :as analyze]))
+ (:require [clojure.tools.analyzer :as analyze]))
(comment
@@ -1,5 +1,5 @@
-(ns clojure.clr.tools.analyzer.examples.nsforms
- (:require [clojure.clr.tools.analyzer :as analyze]))
+(ns clojure.tools.analyzer.examples.nsforms
+ (:require [clojure.tools.analyzer :as analyze]))
(defn warn-on-naked-use [use-expr]
(doseq [s (map :val (:args use-expr))
@@ -1,5 +1,5 @@
-(ns clojure.clr.tools.analyzer.examples.privatevars
- (:require [clojure.clr.tools.analyzer :as analyze]
+(ns clojure.tools.analyzer.examples.privatevars
+ (:require [clojure.tools.analyzer :as analyze]
[clojure.set :as set]
[clojure.pprint :as pp]))
@@ -1,8 +1,8 @@
(set! *warn-on-reflection* false)
-(ns clojure.clr.tools.analyzer.examples.reflection
+(ns clojure.tools.analyzer.examples.reflection
"Same as *warn-on-reflection*"
- (:require [clojure.clr.tools.analyzer :as analyze]))
+ (:require [clojure.tools.analyzer :as analyze]))
(defn check-new [exp]
(when (not (:ctor exp))
@@ -1,7 +1,7 @@
-(ns clojure.clr.tools.analyzer.examples.side-effect
+(ns clojure.tools.analyzer.examples.side-effect
"Warns on invocations of `set!` inside transactions.
Entry point `forbid-side-effects-in-transaction`"
- (:require [clojure.clr.tools.analyzer :as analyze]
+ (:require [clojure.tools.analyzer :as analyze]
[clojure.reflect :as reflect]))
(def transaction-method
@@ -1,5 +1,5 @@
-(ns clojure.clr.tools.analyzer.examples.tail-recursion
- (:require [clojure.clr.tools.analyzer :as analyze]))
+(ns clojure.tools.analyzer.examples.tail-recursion
+ (:require [clojure.tools.analyzer :as analyze]))
;; ## Utility functions
@@ -1,4 +1,4 @@
-(ns clojure.clr.tools.analyzer.fold)
+(ns clojure.tools.analyzer.fold)
(def fold-expr-default ::fold-expr)
@@ -1,8 +1,8 @@
-(ns clojure.clr.tools.analyzer.hygienic
- (:require [clojure.clr.tools.analyzer
+(ns clojure.tools.analyzer.hygienic
+ (:require [clojure.tools.analyzer
[fold :refer [derive-default-fold add-fold-case fold-expr]]
[emit-form :refer [map->form derive-emit-default]]]
- [clojure.clr.tools.analyzer :refer [ast]]))
+ [clojure.tools.analyzer :refer [ast]]))
(declare hygienic-emit hygienic-ast)
@@ -1,4 +1,4 @@
-(ns clojure.clr.tools.analyzer.util
+(ns clojure.tools.analyzer.util
(:require [clojure.pprint :as pp]))
(defn- dissoc-rec
@@ -1,6 +1,6 @@
-(ns clojure.clr.tools.analyzer.test
+(ns clojure.tools.analyzer.test
(:require [clojure.test :refer :all]
- [clojure.clr.tools.analyzer :refer :all]))
+ [clojure.tools.analyzer :refer :all]))
(deftest a-test
(testing "FIXME, I fail."

0 comments on commit cdf79ad

Please sign in to comment.