Re: PersistentTreeMap, seqFrom, subseq and range queries

2015-06-09 Thread Dennis van den Berg
I think the subset and submap would be a nice addition! Op maandag 15 februari 2010 16:23:22 UTC+1 schreef Rich Hickey: On Mon, Feb 15, 2010 at 8:45 AM, George . cloju...@gmail.com javascript: wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap),

PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the subseq wrapper for seqFrom. For instance, let's say your keys are dollar values you could do (subseq my-map 30) to get all entries with keys greater than 30 or (subseq my-map

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
with keys that range between 30 and 11 should read with keys that range between 30 and 100 On Mon, Feb 15, 2010 at 10:45 PM, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the subseq

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread Sean Devlin
If you are running Java 6 you could always use java.util.NavigatibleMap/Set. However, this is a workaround, and it would be great to see Clojure support these log(N) operations directly. On Feb 15, 8:45 am, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
Hey, Sean -- that's the alternative that I've been using for performance reasons. Unfortunately, I can't put it in a ref (well, I suppose I could but the behavior is unspecified and definitely not good). It'd be useful to have both the concurrency benefits of the immutable/persistent

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread Rich Hickey
On Mon, Feb 15, 2010 at 8:45 AM, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the subseq wrapper for seqFrom. For instance, let's say your  keys are dollar values you could do (subseq

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
Sorry, I was mistaken. On Tue, Feb 16, 2010 at 12:23 AM, Rich Hickey richhic...@gmail.com wrote: On Mon, Feb 15, 2010 at 8:45 AM, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the