clojure - IndexedSeq VS. PersistentVector -


can explain me, difference between 'indexedseq' , 'persistentvector'?

i bumped this, when updating vector in data structure via 'rest'. here's repl excerpt shows transformation.

=> (def xs [1 2 3]) ... (type xs) cljs.core/persistentvector => (def xs2 (rest xs)) ... (type xs2) cljs.core/indexedseq 

i'm holding list in app-state atom, needs shifted once in while, first item must disappear. cool, if give me hint data structure might preferable here in terms of performance. elements pushed end of list well, guess it's lifo mechanism i'm creating here.

from last paragraph, sounds you're using stack. taken together, pop, peek, , conj form stack interface can used either lists or vectors (working on front of list or end of vector). use those.

if you're using functions, don't think there should significant performance differences (all 3 functions should constant time).


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -