Summary: I'd like to find a public API to work with the underlying tree of 
a sorted-map.

For example:

(def t (sorted-map 1 :a 2 :b 3 :c 4 :d 5 :e 6 :f)) 

The underlying implementation of sorted-map uses a PersistentTreeMap, which 
can be accessed with `tree`:

(.tree t) ;=> [2 :b]

I have not found a way to access the left and right branches, since calling 
`left` fails:

(.left (.tree t))

IllegalArgumentException Can't call public method of non-public class: 
public clojure.lang.PersistentTreeMap$Node 
clojure.lang.PersistentTreeMap$BlackBranch.left()  
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)

Perhaps it would be reasonable to make such calls possible, at least from 
the Java API (without reflection)?

CLJ-1008 (http://dev.clojure.org/jira/browse/CLJ-1008) offers one possible 
way to support a public API. It was created in 2012. Perhaps it could use 
another look. Thoughts? 

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to