Cases of `RT/canSeq`

2017-05-02 Thread 'Tianxiang Xiong' via Clojure
Why does `clojure.lang.RT/canSeq` need to check both `ISeq` _and_ `Seqable` when `ISeq <- IPersistentCollection <- Seqable`? static public boolean canSeq(Object coll){ return coll instanceof ISeq || coll instanceof Seqable || coll == null || coll instanceof

Re: Leiningen, AOT compilation, and classloaders

2017-03-15 Thread &#x27;Tianxiang Xiong&#x27; via Clojure
Thanks for investigating--any luck? On Friday, 10 March 2017 07:16:32 UTC-8, Mike Rodriguez wrote: > > I haven't been able to get to the bottom of this as of yet. Primarily the > problem is I need to investigate how `lein trampoline` works compared to > without it, from an implementation perspe

Private member variables for deftype

2017-03-10 Thread &#x27;Tianxiang Xiong&#x27; via Clojure
Is there a way of giving a type defined with `deftype` internal member variables? E.g. not passed explicitly in the constructor. With `reify`, we can use a closure : (let [ctx (atom nil) kv-store (atom nil)] (reify Processor ;; ... (in

Leiningen, AOT compilation, and classloaders

2017-03-07 Thread &#x27;Tianxiang Xiong&#x27; via Clojure
I recently ran into an issue with AOT compilation that I'd like to understand better. A minimal working example (MWE) can be found here . Basically, using `:aot :all` in `project.clj` with `lein trampoline test` results in different classloaders

Re: `extend-protocol` order

2017-03-07 Thread &#x27;Tianxiang Xiong&#x27; via Clojure
Thanks, that's vey helpful. On Tuesday, 7 March 2017 11:35:12 UTC-8, Alex Miller wrote: > > Per the docs at https://clojure.org/reference/protocols, if more than one > protocol extension applies and one is derived from the other then the > derived one will be used. In other cases (like two indep

`extend-protocol` order

2017-03-07 Thread &#x27;Tianxiang Xiong&#x27; via Clojure
Does `extend-protocol` guarantee order when used with subtypes? E.g. suppose class Foo implements interface IFoo. Then, extending both Foo and IFoo with protocol Bar: (extend-protocol Bar Foo (do-bar [] "Foo-bar") IFoo (do-bar [] "IFoo-bar")) Is calling `do-bar` on an object o