diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-10-30 13:23:13 -0400 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-10-30 13:23:13 -0400 |
commit | 9c3e97a85c042d2c3f276f0c1e0d270db35553aa (patch) | |
tree | 201bb9c0beea2deed36452f9b9bd870f7bb460e7 /src/jvm | |
parent | 1c8e76b1a0e6616c780902a317a7ab9a8423288b (diff) |
methodnames now take form (.methodname [args] body) in reify/deftype/class
Diffstat (limited to 'src/jvm')
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index 7d1a0633..0b634bb5 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -5350,9 +5350,12 @@ public static class NewInstanceMethod extends ObjMethod{ static NewInstanceMethod parse(ObjExpr objx, ISeq form, Symbol thistag, Map overrideables) throws Exception{ - //(methodname [args] body...) + //(.methodname [args] body...) NewInstanceMethod method = new NewInstanceMethod(objx, (ObjMethod) METHOD.deref()); - Symbol name = (Symbol)RT.first(form); + Symbol dotname = (Symbol)RT.first(form); + if(!dotname.name.startsWith(".")) + throw new IllegalArgumentException("Method names must begin with '.': " + dotname); + Symbol name = (Symbol) Symbol.intern(null,dotname.name.substring(1)).withMeta(RT.meta(dotname)); IPersistentVector parms = (IPersistentVector) RT.second(form); ISeq body = RT.next(RT.next(form)); try |