On Apr 30, 8:16 pm, Nathan Sorenson n...@sfu.ca wrote:
Yes but the contract of subvec is that it returns a persistent
vector and the resulting data structure returns true under the
vector? predicate. I know that subvec returns a different type
because I've looked at the Java source code but
Check this out: http://clojure.org/Transients
On Apr 29, 10:54 am, Nathan Sorenson n...@sfu.ca wrote:
(transient (subvec [1 2 3 4 5] 0 2)) fails with a class cast
exception. Is this expected/unavoidable? How do I know whether the
vectors I'm passed are regular vectors or come via subvec?
I'm
I've read that, and the claim seems to be that Vectors support
transience. Within Clojure's abstraction SubVectors are Vectores:
(vector? (subvec [1 2 3] 0 2)) = true.
On Apr 30, 8:27 am, Armando Blancas armando_blan...@yahoo.com wrote:
Check this out:http://clojure.org/Transients
On Apr 29,
On Sat, Apr 30, 2011 at 11:27 AM, Armando Blancas
armando_blan...@yahoo.com wrote:
On Apr 29, 10:54 am, Nathan Sorenson n...@sfu.ca wrote:
(transient (subvec [1 2 3 4 5] 0 2)) fails with a class cast
exception. Is this expected/unavoidable? How do I know whether the
vectors I'm passed are
Yes but the contract of subvec is that it returns a persistent
vector and the resulting data structure returns true under the
vector? predicate. I know that subvec returns a different type
because I've looked at the Java source code but that's a leaky
abstraction.
On Apr 30, 10:57 am, Ken Wesson
(transient (subvec [1 2 3 4 5] 0 2)) fails with a class cast
exception. Is this expected/unavoidable? How do I know whether the
vectors I'm passed are regular vectors or come via subvec?
I'm assuming I lose all the performance benefits of subvec if I
defensively pour all vectors into a new vector