[bknr-devel] Fwd: searching intervals, sorting and invalid-store-random-state signaled when opening a store

Hans Hübner hans.huebner at gmail.com
Mon Apr 26 09:13:21 UTC 2010


On Mon, Apr 26, 2010 at 08:07,  <madnificent at gmail.com> wrote:
> Searching Intervals:
> Is there some sort of index or a common idiom to search for all objects in
> which a specified property's value lies within a certain interval?  For
> instance: listing/mapping over all widgets which have been created between
> monday and wednesday.  Or all exams of a particular pupil which were scored
> between 35 and 56.  Or should I create filters based on the index-mapvalues
> and index-values?

There is the skip-list-index which has been designed to deal with
ranges and sparse integer valued slots.  The skip-list has a
skip-list-range-cursor class that can be used to iterate over value
ranges.  It is not exposed by the store itself, though, so you'll need
to get the index instance from the class that you want to query and
then call the skip-list-range-index gf on that object.

> Sorting:
> Does an index's index-reader (for instance a string-unique-index (but I'd
> like to know for others as well)) guarantee something with respect to the
> order in which the results are mapped/listed?  If not: is there some idiom
> to receive a sorted list or should I create a custom index to limit the
> amount of sorting?

The order is determined by the underlying index, i.e. hash tables do
not provide ordering, but array indices and skip lists do.

> Condition Signaled:
> Whenever I restart my lisp image in slime and open a previously used store,
> I receive an invalid-store-random-state in SBCL 1.0.37.  Two meaningful
> restarts are given, being initialize-store-random-state and
> ignore-store-random-state.  Is there something obvious I'm doing wrong or is
> this a bug of some sort?

This is a bug, and I think I briefly saw it a few months ago but did
not have the time to fix it.  As far as I remember, SBCL's random
state can no longer be serialized/deserialized with read/write (see
data/txn.lisp).  I'd welcome a patch.

Thanks,
Hans




More information about the Bknr-devel mailing list