diff options
author | Rich Hickey <richhickey@gmail.com> | 2011-03-01 13:03:02 -0500 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2011-03-01 13:03:02 -0500 |
commit | 2b16fee78a0517bc83dd5735ab01d3d5813b1f72 (patch) | |
tree | 2cc9f269aa06c9d8aeb771f8eff389e214520c45 | |
parent | 877c875235aaa7d9bc1bf5392f1c4991e9ea3f63 (diff) |
default impl of with-meta in AFunction generates forwarding wrapper
-rw-r--r-- | src/jvm/clojure/lang/AFunction.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/jvm/clojure/lang/AFunction.java b/src/jvm/clojure/lang/AFunction.java index b03e08cd..908d2c38 100644 --- a/src/jvm/clojure/lang/AFunction.java +++ b/src/jvm/clojure/lang/AFunction.java @@ -23,6 +23,26 @@ public IPersistentMap meta(){ return null; } +public IObj withMeta(final IPersistentMap meta){ + return new RestFn(){ + protected Object doInvoke(Object args) throws Exception{ + return AFunction.this.applyTo((ISeq) args); + } + + public IPersistentMap meta(){ + return meta; + } + + public IObj withMeta(IPersistentMap meta){ + return AFunction.this.withMeta(meta); + } + + public int getRequiredArity(){ + return 0; + } + }; +} + public int compare(Object o1, Object o2){ try { |