diff options
author | Rich Hickey <richhickey@gmail.com> | 2006-09-30 00:00:55 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2006-09-30 00:00:55 +0000 |
commit | 48c28eff6cff167219f030bca3188219604c9a63 (patch) | |
tree | 011fe577cc016be8f475ce5b0645a263fd9709d0 | |
parent | bc8dbcb2c35fe41b38b05a061614bcacfd21f29b (diff) |
interim checkin
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index b5071f32..7a323dc1 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -283,6 +283,7 @@ static class FnExpr extends AnExpr{ for(ISeq methods = RT.seq(this.methods);methods != null;methods = methods.rest()) { + //this will run once if static method FnMethod m = (FnMethod) methods.first(); if(!willBeStaticMethod()) format("public Object ~A(", m.isVariadic()?"doInvoke":"invoke"); @@ -335,7 +336,23 @@ static class FnExpr extends AnExpr{ , key.init.emitExpressionString())); } } + + //local variables + for (ISeq locals = RT.seq(m.locals); locals != null; locals = locals.rest()) + { + LocalBinding b = (LocalBinding) ((MapEntry) locals.first()).key(); + if(!b.isParam) + b.emitDeclaration("null"); + } + + m.body.emitReturn(); + //end of function + format("}~%"); } + + //end of class + if(!willBeStaticMethod()) + format("}~%"); } boolean willBeStaticMethod() { |