diff options
author | Rich Hickey <richhickey@gmail.com> | 2010-10-18 12:51:11 -0400 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2010-10-18 12:51:11 -0400 |
commit | 58be0895bc3c8248ee2c1bb862cf28b86dce8b6c (patch) | |
tree | 9847cf38aa98385346400ebb203e4e8f71fdb8ce | |
parent | ebcdd71828b1d4ec7df79a1dea963ede3e046ca1 (diff) |
neuter :static
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index 77dd68ed..04a17424 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -3333,14 +3333,14 @@ static class InvokeExpr implements Expr{ } } - if(fexpr instanceof VarExpr && context != C.EVAL) - { - Var v = ((VarExpr)fexpr).var; - if(RT.booleanCast(RT.get(RT.meta(v),staticKey))) - { - return StaticInvokeExpr.parse(v, RT.next(form), tagOf(form)); - } - } +// if(fexpr instanceof VarExpr && context != C.EVAL) +// { +// Var v = ((VarExpr)fexpr).var; +// if(RT.booleanCast(RT.get(RT.meta(v),staticKey))) +// { +// return StaticInvokeExpr.parse(v, RT.next(form), tagOf(form)); +// } +// } if(fexpr instanceof KeywordExpr && RT.count(form) == 2 && KEYWORD_CALLSITES.isBound()) { @@ -3457,7 +3457,7 @@ static public class FnExpr extends ObjExpr{ { Symbol nm = (Symbol) RT.second(form); fn.thisName = nm.name; - fn.isStatic = RT.booleanCast(RT.get(nm.meta(), staticKey)); + fn.isStatic = false; //RT.booleanCast(RT.get(nm.meta(), staticKey)); form = RT.cons(FN, RT.next(RT.next(form))); } @@ -4617,7 +4617,11 @@ public static class FnMethod extends ObjMethod{ { Class pc = tagClass(tagOf(p)); if(pc.isPrimitive() && !isStatic) - throw new Exception("Non-static fn can't have primitive parameter: " + p); + { + pc = Object.class; + p = (Symbol) ((IObj) p).withMeta((IPersistentMap) RT.assoc(RT.meta(p), RT.TAG_KEY, null)); + } +// throw new Exception("Non-static fn can't have primitive parameter: " + p); if(pc.isPrimitive() && !(pc == double.class || pc == long.class)) throw new IllegalArgumentException("Only long and double primitives are supported: " + p); |