diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-05-21 16:00:09 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-05-21 16:00:09 +0000 |
commit | 3b4e653ebd901a9d7db97aa64b879f974dc8e64b (patch) | |
tree | d767e125b97f3244c3d7d430913f9b22c3e7832c | |
parent | c5b02d1bf290cfd87df24e01b82831216c39df0a (diff) |
removed (x.member ...) support
-rw-r--r-- | src/genclass.clj | 25 | ||||
-rw-r--r-- | src/parallel.clj | 6 |
2 files changed, 15 insertions, 16 deletions
diff --git a/src/genclass.clj b/src/genclass.clj index 74a2e312..c63da8fd 100644 --- a/src/genclass.clj +++ b/src/genclass.clj @@ -184,12 +184,12 @@ (. gen getStatic ctype (var-name v) var-type) (. gen dup) (. gen invokeVirtual var-type (. Method (getMethod "boolean isBound()"))) - (. gen ifZCmp (GeneratorAdapter.EQ) false-label) + (. gen ifZCmp (. GeneratorAdapter EQ) false-label) (. gen invokeVirtual var-type (. Method (getMethod "Object get()"))) (. gen goTo end-label) (. gen mark false-label) (. gen pop) - (. gen visitInsn (Opcodes.ACONST_NULL)) + (. gen visitInsn (. Opcodes ACONST_NULL)) (. gen mark end-label))) emit-forwarding-method (fn [mname pclasses rclass else-gen] @@ -246,21 +246,21 @@ ;static fields for vars (doseq v var-fields - (. cv (visitField (+ (Opcodes.ACC_PUBLIC) (Opcodes.ACC_FINAL) (Opcodes.ACC_STATIC)) + (. cv (visitField (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_FINAL) (. Opcodes ACC_STATIC)) (var-name v) (. var-type getDescriptor) nil nil))) ;instance field for state (when state - (. cv (visitField (+ (Opcodes.ACC_PUBLIC) (Opcodes.ACC_FINAL)) + (. cv (visitField (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_FINAL)) state-name (. obj-type getDescriptor) nil nil))) ;static init to set up var fields and load clj - (let [gen (new GeneratorAdapter (+ (Opcodes.ACC_PUBLIC) (Opcodes.ACC_STATIC)) - (Method.getMethod "void <clinit> ()") + (let [gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_STATIC)) + (. Method getMethod "void <clinit> ()") nil nil cv)] (. gen (visitCode)) (doseq v var-fields @@ -270,7 +270,7 @@ (. gen putStatic ctype (var-name v) var-type)) (. gen push ctype) - (. gen push (str (name.replace \. (java.io.File.separatorChar)) ".clj")) + (. gen push (str (. name replace \. (. java.io.File separatorChar)) ".clj")) (. gen (invokeStatic rt-type (. Method (getMethod "void loadResourceScript(Class,String)")))) (. gen (returnValue)) @@ -340,7 +340,7 @@ ;factory (when factory (let [fm (new Method factory-name ctype ptypes) - gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (Opcodes.ACC_STATIC)) + gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_STATIC)) fm nil nil cv)] (. gen (visitCode)) (. gen newInstance ctype) @@ -378,8 +378,8 @@ ;main (when main - (let [m (Method.getMethod "void main (String[])") - gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (Opcodes.ACC_STATIC)) + (let [m (. Method getMethod "void main (String[])") + gen (new GeneratorAdapter (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_STATIC)) m nil nil cv) no-main-label (. gen newLabel) end-label (. gen newLabel)] @@ -413,7 +413,7 @@ (. gen (returnValue)) (. gen (endMethod)))) (when setter - (let [m (new Method (str setter) (Type.VOID_TYPE) (into-array [ftype])) + (let [m (new Method (str setter) (. Type VOID_TYPE) (into-array [ftype])) gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)] (. gen (visitCode)) (. gen loadThis) @@ -445,7 +445,7 @@ [path name & options] (let [{:keys [name bytecode]} (apply gen-class (str name) options) - file (java.io.File. path (str (name.replace \. (java.io.File.separatorChar)) ".class"))] + file (java.io.File. path (str (. name replace \. (. java.io.File separatorChar)) ".class"))] (.createNewFile file) (with-open f (java.io.FileOutputStream. file) (.write f bytecode)))) @@ -508,4 +508,3 @@ :extends javax.servlet.http.HttpServlet) ) - diff --git a/src/parallel.clj b/src/parallel.clj index a60f7bbb..bc9d5a9a 100644 --- a/src/parallel.clj +++ b/src/parallel.clj @@ -115,9 +115,9 @@ pvec. ([coll] (if (instance? ParallelArrayWithMapping coll) coll - (ParallelArray.createUsingHandoff + (. ParallelArray createUsingHandoff (to-array coll) - (ParallelArray.defaultExecutor)))) + (. ParallelArray defaultExecutor)))) ([coll & ops] (reduce (fn [pa [op args]] (cond @@ -151,7 +151,7 @@ pvec. ([coll comp] (. (par coll) min comp))) (defn- summary-map [s] - {:min (s.min) :max (s.max) :size (s.size) :min-index (s.indexOfMin) :max-index (s.indexOfMax)}) + {:min (.min s) :max (.max s) :size (.size s) :min-index (.indexOfMin s) :max-index (.indexOfMax s)}) (defn psummary "Returns a map of summary statistics (min. max, size, min-index, max-index, |