public ISeq seqFrom(object key, bool ascending)
{
if (_count > 0)
{
ISeq stack = null;
Node t = _tree;
while (t != null)
{
int c = DoCompare(key, t.Key);
if (c == 0)
{
stack = RT.cons(t, stack);
return new Seq(stack, ascending);
}
else if (ascending)
{
if (c < 0)
{
stack = RT.cons(t, stack);
t = t.Left;
}
else
t = t.Right;
}
else
{
if (c > 0)
{
stack = RT.cons(t, stack);
t = t.Right;
}
else
t = t.Left;
}
}
if (stack != null)
return new Seq(stack, ascending);
}
return null;
}