[cells-devel] allegrocache

Ken Tilton kennytilton at optonline.net
Fri Dec 14 01:44:18 UTC 2007


rkm1000 wrote:
> Hi all,
> 
> I decided to take a shot at cells and allegrocache.

This is pretty scary, two hours earlier I got invited to talk at ILC 
2008 and thought I would do RDFCells.

> I started by  adding 
> (:metaclass db.ac:persistent-class) to model-object.
> Committing  changes 
> revealed that allegocache doesn't know how to encode  cells::cells or 
> cells::c-dependent. I expected that would be the case.
> 
> Allegrocache will encode structures when provided a method encode- 
> object, but I've run into a couple of problems. Encoding the caller- 
> store member of a cells struct leads to a stack overflow. I imagine  
> allegrocache handles circular references when dealing with collections  
> of CLOS objects, but it doesn't appear to do so with encode-object and  
> structs. At least that is what I'm thinking is the problem for now...

Yeah, you have to manage circularities yourself, but one does the same 
when using print/read for serialization, I guess the standard is to 
force the client to handle circs.

> 
> The other problem is with the rule member of c-ruled. Is serializing a  
> function even possible?

Either use EVAL or a diabolical trick: for any lambda you want to store, 
define a persistent class with a slot with an initform producing that 
lambda. AC has to convert that to an initform-function, which you can 
then call to get lambdas. Sick. If you have a suitable Franz license, 
just use eval. The other issue is getting the form defining the lambda 
saved. I think Cells keeps rules in symbolic form in a slot for 
debugging purposes, so you just need to make sure that gets stored.

> 
> I have suspicions about solutions to both of these, but before I  bloody 
> my forehead I thought I would ask if anyone has attempted to  use  
> allegrocache with cells and what their experiences have been.

I did AllegroStore+Cells. At the time Cells was mop-based and Astore 
played nice with the MOP. Went incredibly well, but I did have to add a 
layer of code to achieve the functionality I desired. Probably a full 
few weeks effort.

Well worth it and quite exciting to see (a) a self-updating database and 
(b) seamless auto-update of any view of the DB as the DB changed 
underneath it.

kt



More information about the cells-devel mailing list