Folks--
I've got a class I can't change which has an abstract method I'd like
to override using the proxy macro in Clojure.
The class looks something like:
public abstract class Foo {
private Map stuff;
private void initStuff() {
stuff = new HashMap();
stuff.put("a", new Object());
addStuff(stuff);
}
protected void abstract addStuff(Map stuff);
}
Normally, you extend the above and implement the addStuff method.
Works in Groovy as long as I explicitly state the void return type and
the type of the parameters.
In Clojure, I construct:
(proxy [Foo] []
(addStuff [stuff] (println "yay!")))
But get an AbstractMethodError when I attempt to use the Foo class
(calling a method which eventually calls addStuff).
The docs suggest I can override a protected method class, but can't
call other protected methods, which I think is fine, here.
Is there something I'm missing?
Keith
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en