Library(rbtrees) does not backtrack?

Correct me if I’m wrong but it seems that rbtree doesn’t backtrack?

I do something a bit like this:

foldl([K,V,T0,T]>>rb_insert(T0,K,V,T), Keys, Values, EmptyTree, FullTree)

and I find that EmptyTree is modified!

I make note of this because the documentation doesn’t say that anywhere so far as I can see: rbtrees.pl -- Red black trees.

That would be quite unexpected. I can’t reproduce this in a trivial example. Please share complete code we can run.

Thank you, then it must be something I’ve done somewhere.