Index: trunk/src/boot.clj
===================================================================
--- trunk/src/boot.clj	(revision 812)
+++ trunk/src/boot.clj	(working copy)
@@ -770,6 +770,13 @@
   [#^clojure.lang.Reversible rev]
     (. rev (rseq)))
 
+(defn seq-from
+  "Returns the in-order sequence of sortedmap entries >= key"
+  [sortedmap key] (. clojure.lang.RT (seqFrom sortedmap key)))
+(defn rseq-from
+  "Returns the reverse-order sequence of sortedmap entries <= key"
+  [sortedmap key] (. clojure.lang.RT (rseqFrom sortedmap key)))
+
 (defn name
   "Returns the name String of a symbol or keyword."
   [#^clojure.lang.Named x]
@@ -1158,6 +1165,60 @@
 		   (reduce merge-entry m1 (seq m2)))]
       (reduce merge2 maps)))
 
+(let
+	[get-comp
+		; Retrieves comparator from sorted map or returns default comparator.
+		(fn [smap]
+			(or
+				(. smap comp)
+				(fn [a b]
+					(. a (compareTo b)))))]
+	(defn seq-after
+		"Returns the in-order sequence of sortedmap entries > key"
+		[sortedmap skey]
+		(if sortedmap
+			(let [s (seq-from sortedmap skey)]
+				(if
+					(== 0 ((get-comp sortedmap) (key (first s)) skey))
+					(rest s)
+					s))))
+	(defn rseq-before
+	  "Returns the reverse-order sequence of sortedmap entries < key"
+		[sortedmap skey]
+		(if sortedmap
+			(let [s (rseq-from sortedmap skey)]
+				(if
+					(== 0 ((get-comp sortedmap) (key (first s)) skey))
+					(rest s)
+					s))))
+	(defn find<
+		"Returns the greatest sortedmap entry less than key, or nil if no match present."
+		[sortedmap key] (first (rseq-before sortedmap key)))
+	(defn find<=
+		"Returns the greatest sortedmap entry less than or equal to key, or nil if no match present."
+		[sortedmap key] (first (rseq-from sortedmap key)))
+	(defn find>
+		"Returns the smallest sortedmap entry greater than key, or nil if no match present."
+		[sortedmap key] (first (seq-after sortedmap key)))
+	(defn find>=
+		"Returns the smallest sortedmap entry greater than or equal to key, or nil if no match present."
+		[sortedmap key] (first (seq-from sortedmap key)))
+	(defn seq-from-to
+		"Returns an ordered sequence of items x from sortedmap such that from <= (key x) <= to."
+		[sortedmap from to]
+		(let [cmp (get-comp sortedmap)]
+			(take-while
+				(fn [x]
+					(<= (cmp (key x) to) 0))
+				(seq-from sortedmap from))))
+	(defn rseq-from-to
+		"Returns a reverse-ordered sequence of items x from sortedmap such that from >= (key x) >= to."
+		[sortedmap from to]
+		(let [cmp (get-comp sortedmap)]
+			(take-while
+				(fn [x]
+					(>= (cmp (key x) to) 0))
+				(rseq-from sortedmap from)))))
 
 
 (defn zipmap
Index: trunk/src/jvm/clojure/lang/RT.java
===================================================================
--- trunk/src/jvm/clojure/lang/RT.java	(revision 812)
+++ trunk/src/jvm/clojure/lang/RT.java	(working copy)
@@ -511,6 +511,17 @@
 	return ((Associative) coll).entryAt(key);
 }
 
+static public Object seqFrom(Object coll, Object key){
+	if(coll == null)
+		return null;
+	return ((PersistentTreeMap) coll).seqFrom(key);
+}
+static public Object rseqFrom(Object coll, Object key){
+	if(coll == null)
+		return null;
+	return ((PersistentTreeMap) coll).rseqFrom(key);
+}
+
 //takes a seq of key,val,key,val
 
 //returns tail starting at val of matching key if found, else null
Index: trunk/src/jvm/clojure/lang/PersistentTreeMap.java
===================================================================
--- trunk/src/jvm/clojure/lang/PersistentTreeMap.java	(revision 812)
+++ trunk/src/jvm/clojure/lang/PersistentTreeMap.java	(working copy)
@@ -126,12 +126,30 @@
 	return null;
 }
 
+public ISeq seqFrom(Object key){
+	if(_count > 0)
+		{
+		ISeq stack = searchGreaterEq(key);
+		return stack != null ? new Seq(stack, true, -1) : null;
+		}
+	return null;
+}
+
+
 public ISeq rseq() throws Exception{
 	if(_count > 0)
 		return Seq.create(tree, false, _count);
 	return null;
 }
 
+public ISeq rseqFrom(Object key){
+	if(_count > 0)
+		{
+		ISeq stack = searchLessEq(key);
+		return stack != null ? new Seq(stack, false, -1) : null;
+		}
+	return null;
+}
 
 public NodeIterator iterator(){
 	return new NodeIterator(tree, true);
@@ -229,6 +247,49 @@
 	return t;
 }
 
+ISeq searchGreaterEq(Object key){
+	ISeq stack = null;
+	Node t = tree;
+	while(t != null)
+		{
+		int c = doCompare(key, t.key);
+		if(c == 0)
+			{
+			stack = RT.cons(t, stack);
+			return stack;
+			}
+		else if(c < 0)
+			{
+			stack = RT.cons(t, stack);
+			t = t.left();
+			}
+		else
+			t = t.right();
+		}
+	return stack;
+}
+ISeq searchLessEq(Object key){
+	ISeq stack = null;
+	Node t = tree;
+	while(t != null)
+		{
+		int c = doCompare(key, t.key);
+		if(c == 0)
+			{
+			stack = RT.cons(t, stack);
+			return stack;
+			}
+		else if(c > 0)
+			{
+			stack = RT.cons(t, stack);
+			t = t.right();
+			}
+		else
+			t = t.left();
+		}
+	return stack;
+}
+
 public int doCompare(Object k1, Object k2){
 	if(comp != null)
 		return comp.compare(k1, k2);
