On Dec 11, 3:33 pm, ataggart <alex.tagg...@gmail.com> wrote:
> On Dec 11, 12:44 pm, Keith Irwin <keith.ir...@gmail.com> wrote:
>
>
>
>
>
> > On Fri, Dec 11, 2009 at 12:27 PM, Keith Irwin <keith.ir...@gmail.com> wrote:
> > > 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);
> > >  }
> > > In Clojure, I construct:
>
> > >    (proxy [Foo] []
> > >       (addStuff [stuff] (println "yay!")))
>
> > I should amend this to say that I get an AbstractMethodError when the
> > (proxy ...) is evaluted. I'm running the code as a script.
>
> > Keith
>
> Hmm, this works fine for me:
>
> user=> (def mymap (proxy [java.util.AbstractMap] [] (entrySet []
> (println "yay!"))))
> #'user/mymap
> user=> (.entrySet mymap)
> yay!
> nil

The case I have is that a method in the abstract class is calling the
abstract method, and my proxy object doesn't seem to, uh, proxy that
method at all. So, in your example, there's have to be some other
method in AbstractMap that called entrySet. If that worked, then I'd
really be wondering what's going on.

Argh! ;)

Keith

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to