Re: Proxies and overriding protected methods

2012-01-16 Thread Cedric Greevey
On Mon, Jan 16, 2012 at 5:29 PM, Norman Gray wrote: >> Anything called by a Java library in a tight loop via an interface, >> though, you might prefer reify for. Reify has some other features, >> too, and probably some other limitations. Though there's a sizable >> overlap region where either can

Re: Proxies and overriding protected methods

2012-01-16 Thread Norman Gray
Cedric, hello. Thanks for these further notes. Following your remarks and Chris's, I've logged this as a bug at I've added a few further comments below. On 16 Jan 2012, at 17:56, Cedric Greevey wrote: > A proper clojure finalizer would > have to b

Re: Proxies and overriding protected methods

2012-01-16 Thread Cedric Greevey
On Sun, Jan 15, 2012 at 5:26 PM, Norman Gray wrote: > Section 6.6.2 of the JLS mentions that "A protected member or constructor of > an object may be accessed from outside the package in which it is declared > only by code that is responsible for the implementation of that object"   > (this is e

Re: Proxies and overriding protected methods

2012-01-16 Thread Norman Gray
Chris, hello. On 2012 Jan 16, at 11:23, Chris Perkins wrote: > Oops, ignore that - haven't had my morning coffee yet :) I see that you > are trying to make finalize accessible by overriding it. Indeed! > Agreed that it > seems like it should work. Assuming that proxy can successfully overr

Re: Proxies and overriding protected methods

2012-01-16 Thread Chris Perkins
On Monday, January 16, 2012 6:12:34 AM UTC-5, Chris Perkins wrote: > > Norman, > > Finalize is a protected method, so you can't call it. You get the same > error trying to call finalize on anything - it has nothing to do with proxy. > > user> (.finalize (Object.)) > No matching field found: finali

Re: Proxies and overriding protected methods

2012-01-16 Thread Chris Perkins
Norman, Finalize is a protected method, so you can't call it. You get the same error trying to call finalize on anything - it has nothing to do with proxy. user> (.finalize (Object.)) No matching field found: finalize for class java.lang.Object - Chris -- You received this message because yo

Re: Proxies and overriding protected methods

2012-01-15 Thread Norman Gray
Cedric, hello. On 2012 Jan 15, at 20:32, Cedric Greevey wrote: > On Sun, Jan 15, 2012 at 6:52 AM, Norman Gray wrote: >> user=> (def m (proxy [java.util.HashMap] [] >>(finalize [] >> ;(proxy-super finalize) >> (prn "finalizing...")) >>(hashCode [] >> 9

Re: Proxies and overriding protected methods

2012-01-15 Thread Cedric Greevey
On Sun, Jan 15, 2012 at 6:52 AM, Norman Gray wrote: > > Greetings. > > I'm not understanding proxies. Can anyone advise me what I'm missing? > > I try the following: > > user=> (def m (proxy [java.util.HashMap] [] > (finalize [] > ;(proxy-super finalize) > (prn "finali

Proxies and overriding protected methods

2012-01-15 Thread Norman Gray
Greetings. I'm not understanding proxies. Can anyone advise me what I'm missing? I try the following: user=> (def m (proxy [java.util.HashMap] [] (finalize [] ;(proxy-super finalize) (prn "finalizing...")) (hashCode [] 99))) #'user/m user=> (.