[elephant-devel] Re: Array slots

Alex Mizrahi killerstorm at newmail.ru
Tue Apr 29 19:24:20 UTC 2008


 LPP> (32): (setf (aref (slot-value sch 'a) 2) 1)
 LPP> 1

 LPP> (33): (slot-value sch 'a)
 LPP> #(0 0 0 0)

how do you thik it is supposed to work?
to my knowledge, elephant does not hijack (setf aref), so (setf aref) just 
modifies a temporary array returned by a slot read.
db is written _only_ on (setf slot-value), if you do not explicitly write to 
slot, value in database won't be updated.
it seems this stuff is in documentation:

----
2.7 Persistent collections

The remaining problem outlined in the section on Serialization is that 
operations which mutate collection types do not have persistent side 
effects. We have solved this problem for objects, but not for collections 
such as as arrays, hashes or lists. Elephant provides two solutions to this 
problem: the pset and btree classes. Each provides persistent addition, 
deletion and mutation of elements, but the pset is a simple data structure 
that may be more efficient in memory and time than the more general btree.
---- 






More information about the elephant-devel mailing list