Interactions of d/basis-t, d/as-of, d/with


#1

I was expecting for dbvals to have the same value semantics as Clojure data structures. This would mean I can have multiple timelines. In git parlance, “rewind and branch from past”. I understand that if the branch was pushed it would be a merge.

This does not work as I expected. My present understanding is: d/with will return a dbval with the most up-to-date d/basis-t which has been constrained by setting a d/as-of flag. So all dbvals will always have a basis-t of the highest t value known to the peer.

What is going on? Why is it implemented this way?

Here is a gist demonstrating the weird semantics

Thanks


#2

I now understand that as-of is implemented as a filter, and the semantics of using d/with on a filtered dbval is not clear or perhaps meaningless. Though things are still a little murky to me as to the exact semantics and if branching from the past is a reasonable thing to want to do (given that it can never be transacted) and why it is the way it is and not like Clojure’s data structures.