What would you call an inconsistent data structure that allows you to perform persistent operations?

I have a class that is essentially mutable, but allows some "persistent" operations. For example, I can mutate an object like this (in Python):

# create an object with y equal to 3 and z equal to "foobar" x = MyDataStructure(y = 3, z = "foobar") xy = 4 

However, instead, there are several methods that instead make a copy and then mutate it:

 x = MyDataStructure(y=3, z="foobar") # a is just like x, but with y equal to 4. a = x.using(y = 4) 

This creates a duplicate x with different values. This does not seem to fit the definition of partial durability given by wikipedia .

So what would you call such a class? QuasiPersistentObject? PersistableObject? SortOfPersistentObject? Even better, are there any technical names for this?

+4
source share
2 answers

I call this data Persistable , but not sure what the word is.

+2
source

This is just an optimized copy, I would prefer to rename the operation to reflect this.

 a = x.copy_with(y=4) 
+2
source

All Articles