Re: Calling proxy without reflection

2018-08-02 Thread Nicola Mometto
https://dev.clojure.org/jira/browse/CLJ-2379 > On 2 Aug 2018, at 10:22, Nicola Mometto wrote: > > yes, the problem is with `proxy` and redefinition, I'm working on a patch to > fix this > >> On 2 Aug 2018, at 07:55, Mark Engelberg > > wrote: >> >> For those fo

Re: Calling proxy without reflection

2018-08-02 Thread Nicola Mometto
yes, the problem is with `proxy` and redefinition, I'm working on a patch to fix this > On 2 Aug 2018, at 07:55, Mark Engelberg wrote: > > For those following along at home, it turned out not to be a problem with the > lein-virgil plugin. It's apparently a bug in Clojure. Renzo and I distill

Re: Calling proxy without reflection

2018-08-02 Thread Matching Socks
And there's less! It's not necessary to issue the first (defn... or (get-test... (I tried in Clojure 1.8 only) -- 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 me

Re: Calling proxy without reflection

2018-08-01 Thread Mark Engelberg
For those following along at home, it turned out not to be a problem with the lein-virgil plugin. It's apparently a bug in Clojure. Renzo and I distilled it down to the following steps: user=> (definterface Interface (test [])) user.Interface user=> (def p (proxy [Object Interface] [] (test [] 1

Re: Calling proxy without reflection

2018-08-01 Thread Renzo Borgatti
Commented in pull request https://github.com/Engelberg/mister-rogers/pull/1 > On 1 Aug 2018, at 02:38, Mark Engelberg wrote: > > I am seeing the same behavior when I remove the lein-virgil plugin. > > On Tue, Jul 31, 2018 at 11:38 AM, Mark Engelberg > wrote: > That's surprising, but good to k

Re: Calling proxy without reflection

2018-07-31 Thread Mark Engelberg
I am seeing the same behavior when I remove the lein-virgil plugin. On Tue, Jul 31, 2018 at 11:38 AM, Mark Engelberg wrote: > That's surprising, but good to know. Thanks. > > On Tue, Jul 31, 2018 at 9:56 AM, Renzo Borgatti > wrote: > >> Hey Mark, it's lein-virgil interfering. As of why, better

Re: Calling proxy without reflection

2018-07-31 Thread Mark Engelberg
That's surprising, but good to know. Thanks. On Tue, Jul 31, 2018 at 9:56 AM, Renzo Borgatti wrote: > Hey Mark, it's lein-virgil interfering. As of why, better opening an issue > there. > > Renzo > > > On 30 Jul 2018, at 11:50, Mark Engelberg > wrote: > > > > OK, I just pushed the repo (work in

Re: Calling proxy without reflection

2018-07-31 Thread Renzo Borgatti
Hey Mark, it's lein-virgil interfering. As of why, better opening an issue there. Renzo > On 30 Jul 2018, at 11:50, Mark Engelberg wrote: > > OK, I just pushed the repo (work in progress) to github. > https://github.com/Engelberg/mister-rogers > At the bottom of mister-rogers.wrappers I tacke

Re: Calling proxy without reflection

2018-07-30 Thread Nicola Mometto
Ok, just taking a cursory look and what you're seeing might be related to double-loading. It might be that the fixes that went in around ~1.5/1.6 missed some edge-cases related to `proxy`, I'll investigate more this evening > On 30 Jul 2018, at 11:50, Mark Engelberg wrote: > > OK, I just push

Re: Calling proxy without reflection

2018-07-30 Thread Mark Engelberg
OK, I just pushed the repo (work in progress) to github. https://github.com/Engelberg/mister-rogers At the bottom of mister-rogers.wrappers I tacked on the three lines we've been discussing. https://github.com/Engelberg/mister-rogers/blob/523fc29f8827193fa9ea6ae2e82649e2933e6ae3/src/clj/mister_rog

Re: Calling proxy without reflection

2018-07-30 Thread Nicola Mometto
Can you paste an entire repl session, starting from how you launch it (e.g. lein repl vs clj -- ideally not from a project) reproducing this? I'm interested in taking a look but I simply cannot repro :/ > On 30 Jul 2018, at 11:40, Mark Engelberg wrote: > > Yes, it is in a fresh environment. >

Re: Calling proxy without reflection

2018-07-30 Thread Mark Engelberg
Yes, it is in a fresh environment. I find that the problematic example *does* work in the user namespace, but it doesn't work in my segmented namespace (ns mister-rogers.wrappers, to be really specific). On Mon, Jul 30, 2018 at 3:34 AM, Nicola Mometto wrote: > No, I just tested this on 1.9.0 an

Re: Calling proxy without reflection

2018-07-30 Thread Nicola Mometto
No, I just tested this on 1.9.0 and 1.8.0 and I get no reflection, as I'd expect. Are you testing this in a fresh environment? > On 30 Jul 2018, at 11:31, Mark Engelberg wrote: > > I'm using 1.9.0. Is this a behavior that recently changed? > > On Mon, Jul 30, 2018 at 3:28 AM, Nicola Mometto

Re: Calling proxy without reflection

2018-07-30 Thread Mark Engelberg
I'm using 1.9.0. Is this a behavior that recently changed? On Mon, Jul 30, 2018 at 3:28 AM, Nicola Mometto wrote: > Which version of clojure? This works fine in 1.10 > > Clojure 1.10.0-master-SNAPSHOT > user=> (set! *warn-on-reflection* true) > true > user=> (definterface Interface (test [])) >

Re: Calling proxy without reflection

2018-07-30 Thread Nicola Mometto
Which version of clojure? This works fine in 1.10 Clojure 1.10.0-master-SNAPSHOT user=> (set! *warn-on-reflection* true) true user=> (definterface Interface (test [])) user.Interface user=> (def p (proxy [Object Interface] [] (test [] 1))) #'user/p user=> (defn get-test [o] (.test ^Interface o)) #

Re: Calling proxy without reflection

2018-07-30 Thread Mark Engelberg
Those fishy things were errors I made when simplifying and transcribing the proxy to post, but I have it correct in my own code. Here's a more precise, tested minimal example: (definterface Interface (test [])) (def p (proxy [Object Interface] [] (test [] 1))) (defn get-test [o] (.test ^Interface

Re: Calling proxy without reflection

2018-07-30 Thread Nicola Mometto
That's exactly what you should do and it does work, e.g.: user=> (set! *warn-on-reflection* true) true user=> (.meta ^clojure.lang.IMeta (proxy [clojure.lang.IMeta] [] (meta [] {:a 1}))) {:a 1} In your small example you have two errors that might be fishy: a missing arg vector to pass to the su