Ok, working on it.

Rich Hickey a écrit :
>
> On Mar 9, 5:04 am, Timothy Pratley <timothyprat...@gmail.com> wrote:
>   
>> Hi Paul,
>>
>>     
>>> I actually mentioned the cycle function in my message, and that's what
>>> I was using, but the original question came up because accessing the
>>> nth item in a list takes linear rather than constant time.
>>>       
>> Apologies for not reading your post carefully. Indeed I think your
>> cyclic-vector solution is great.
>>
>>     
>>> I'd be interested to hear how what I was attempting violates the
>>> spirit of clojure. I was trying to work within the bounds of an
>>> existing abstraction, and to implement my changes in such a way as to
>>> not break other things that consume that abstraction.
>>>       
>> Interop with Java is a real strength of Clojure. But doing so is less
>> useful for learning Clojure and more useful for learning Java. Feel
>> free to pursue it, Java interop is certainly not wasted effort/
>> knowledge. It certainly doesn't violate the spirit of Clojure, my
>> words were intended in relation to writing Euler solutions in a non-
>> Java way.
>>
>>     
>>> Incidentally, I don't believe the error I'm getting from proxy has
>>> anything to do with IPersistentVector being an interface, since you
>>> can clearly do:
>>>       
>>> (proxy [clojure.lang.IFn] [])
>>>       
>> Indeed you can, but you've really just created an empty object:
>> user=> ((proxy [clojure.lang.IFn] []))
>> java.lang.UnsupportedOperationException: invoke (NO_SOURCE_FILE:0)
>>
>> Now back to IPersistentVector for a moment:
>> This class extends lots of interfaces. There is a name overlap between
>> some of those Interfaces resulting in a very valid error "Duplicate
>> method name&signature". Not a bug with proxy.
>>
>>     
>
> I really don't know why you are trying to dissuade Paul in all this.
> What he is trying to do is perfectly fine and it does in fact look
> like a bug in proxy. It is not an error to inherit a same-sig method
> from more than one interface, but proxy is probably generating more
> than one stub method, which is the error.
>
> I'm prepping for my London QCon trip and don't have time to chase
> this, but would appreciate it if a contributor could please file an
> issue and look into this.
>
> Thanks,
>
> Rich
>
>
> >
>
>   


-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)



--~--~---------~--~----~------------~-------~--~----~
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
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