3 ms·
Yeah, I couldn't follow the descriptions either. It looks like "list" only supports appending (conj), removing the first item (rest), and removing all items (e
by dunham 8y ago
Yeah, I couldn't follow the descriptions either.
It looks like "list" only supports appending (conj), removing the first item (rest), and removing all items (empty).
The data consists of a list of items, a "clock" (map of nodeId to Date object), and a list of (nodeId,Date) corresponding to the values.
I think they're using the clock to determine whether to drop deleted items on merge. Code for the operations is [list.cljc:153-169](https://github.com/aredington/schism/blob/master/src/schism/impl/types/list.cljc#L153-L169 https://github.com/aredington/schism/blob/master/src/schism/...). The merge code is "synchronize" a little further down (I didn't read through it).
The "vector" object supports append (conj), pop, clearing the list (empty), and setting a value at a position (assoc). It does _not_ support insert/delete. It is structured similarly to "list" except using vectors instead of lists for the values and the timestamps. Code is at [vector.cljc:222-244](https://github.com/aredington/schism/blob/master/src/schism/impl/types/vector.cljc#L222-L244 https://github.com/aredington/schism/blob/master/src/schism/...)