Thanks very much, that makes a lot of sense. I looked through the java code for PersistentTreeMap, and indeed those methods are private.
I think that I'll be happy with subseq and rsubseq. Being a noob, it hadn't occured to me that I could do that. On Dec 30, 8:04 pm, Timothy Pratley <timothyprat...@gmail.com> wrote: > 2009/12/31 Rob Lachlan <robertlach...@gmail.com>: > > > About a year and a half ago, there was some discussion about having a > > function that would enable some kind of bounded search on a sorted > > Does this exist, currently? I haven't looked at the gory details of > > subseq and rsubseq provide efficient bounded searching. > I don't see the need for find or seek as that is really just (first (subseq > sm)) > > For your particular problem (find closest) a combination of first > subseq >= and first rsubseq <= will find you the two best candidates > on either side, and thus which is closest. However this is slightly > more work than if you could just do one efficient search and then > access the key to the other side of the test... which is a different > proposition all together than bounded search but if it is useful > sounds easy enough to expose. Currently you can access the tree itself > (.tree sm) works, but you can't find out what's to the left or right > because those are private. Do you want to navigate the tree, or would > a left and right search suffice? > > Regards, > Tim. -- 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 Note that posts from new members are moderated - please be patient with your first post. 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