[elephant-devel] Re: Derived Indicies

Ian Eslick eslick at media.mit.edu
Fri Mar 21 22:46:58 UTC 2008


Sigh...

Ok, I'll make sure the same facility is available in the new code base.

How painful would it be if I changed the interface to this  
functionality?  I'd like to make derived indices part of the class  
definition rather than a dynamic facility.  It simplifies schema  
evolution to have all the specs for a given class in one place so  
there is one master 'version' of the object to work from.

I'm thinking something like:

(defpclass foo ()
   ((slot1 :accessor slot1 ...)
    (slot2 :accessor slot2 ...)
    (slot3 :accessor slot3 ...)
    (derived :reader foo-value :derived-fn my-fn :index t :slot-deps  
(slot1 slot3))))

This means you now have an indexed slot who's index value is  
determined by the value returned by my-fn whenever slot1 or slot3 are  
written.  No slot storage is actually used.  If you use the reader, it  
just calls my-fn on the object to give you a value.

You can also register a lambda expression instead of a function symbol.

Would this work for your system?

Ian


On Mar 21, 2008, at 6:40 PM, Alex Mizrahi wrote:
> IE> Does anyone actually use derived indices in the current slot  
> indexing
> IE> model?
>
> add-class-derived-index?
> yep, we are using them, as they are only way to make some non-trivial
> lookups
>
>
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel




More information about the elephant-devel mailing list