[cells-devel] Triple cells
Ken Tilton
kennytilton at optonline.net
Thu Jun 12 16:12:43 UTC 2008
Watt Poosanguansit wrote:
> Hi Ken,
>
> I have got a hold of your slides at the European
> Common Lisp Meeting. I also looked through Triple
> Cell code and I still do not know how to really use
> the code. A few questions I have to start off. It
> looks to me like the code stores only the slots and
> not the whole Clos object.
> Is that the case?
Actually triple-cells is an entirely new hack that just tries to work
like CLOS Cells, with a little glue so a dynamic CLOS slot can depend on
a Triple-cell /maintained by the same process/. (In a multi-user
environment we would have to get into a whole protocol and IPC.)
This is good. RDF is more expressive than CLOS, so let's not cramp it.
That said, the little bit I did do with Triple-cells did kinda follow an
object-slot view of data, so it might seem as if I was thinking
persistent CLOS, but if I were extending triple-cells I would not let
CLOS drive what is possible.
> If yes,
> how do I persist the whole Clos cell object?
Well, I think you mean CLOS object. A cell is a defstruct. But I think I
know what you mean.
Triple-cells is just a proof of concept to show how persistent data can
be driven by something like Cells for CLOS. To do persistent CLOS would
be a different, non-trivial project and might miss the coolness of RDF.
I would suggest letting RDF be RDF and CLOS be CLOS. I know and
appreciate the advantage of transparently making CLOS persistent, but I
am strting to wonder if it should not be the other way around: should we
forget CLOS and start working on a dynamic object model tailored after RDF?
> Also, if
> I have a cell object that is the composite of other
> cell objects - Document A has a number of Document B.
> I want to state a rule saying A can not have more than
> 5 B associated with it. How to simply state that in
> Clos and Cell?
If you want to allow the sixth B and raise an error, you would have an
"errors" rule on A that simply says:
(when (> (length (^A)) 5) (make-instance 'too-many-b))
If you want to prevent the sixth B from getting in, you would have to
stop it via some add-b-to-a function that checks first of the maximum
has been reached, ie, the old-fashioned way and not using Cells.
> I am sorry for the newbie type
> questions. I hope you can include more samples code
> so it will be easier for new comers to follow. Thanks
> for your help.
I am afraid I am incredibly busy these days and won't have time for more
than an occasional email. :(
kt
More information about the cells-devel
mailing list