[rucksack-devel] Et tu, prevalence?

Nikodemus Siivola nikodemus at random-state.net
Fri May 19 19:43:50 UTC 2006


"Arthur Lemmens" <alemmens at xs4all.nl> writes:

> I feel uneasy about references between prevalent and persistent objects,
> for one thing.

Potential quicksand there, I can believe.

> Another thing is: if you just specify a :prevalent flag when creating a
> rucksack and can't have both kinds in one rucksack, you wouldn't even
> need to make separate classes for prevalent objects; instances of
> persistent-object could just be treated differently for prevalent
> rucksacks.  So you wouldn't have to have separate
> (defclass foo () () (:metaclass persistent-class) and
> (defclass bar () () (:metaclass prevalent-class) definitions in your
> program.  And you wouldn't need to change from one to the other when
> you decide to change from persistence to prevalence or vice versa.

The reason why I think it is important to have them as separate metaclasses
(with their own root-classes) is that they will have somewhat different
semantics.

* holding on to a reference to a prevalent-object outside a
  transaction is not a problem.

* reading a slot of a prevalent-object outside a transaction
  could be permitted.

* two prevalent-objects with same object-id's are always EQ.

Making the distinction at class-level makes things easier for
user-level code, and probably keeps the implementation cleaner too.

> I have no intentions of actually writing this prevalent variant, by the
> way.  But I think it would be a useful addition to Rucksack and if you
> feel like writing it, I'd be happy to integrate it.

Already started. ,-)

Cheers,

  -- Nikodemus              Schemer: "Buddha is small, clean, and serious."
                   Lispnik: "Buddha is big, has hairy armpits, and laughs."



More information about the rucksack-devel mailing list