Nil in an index

Norberto Manzanos nmanzanos at gmail.com
Fri Jan 11 14:43:07 UTC 2008


Hi!

Is it a good idea avoid nil in magma indexes?
This question rised when I tried MaDateIndex. Until this moment, I used
String or Integer indexes having care to answer allways a String (an empty
string if the object is nil) and an  Integer (a zero if nil). But with dates
there is a conceptual problem: there is not a null date. In some
applications, business stuff, for example, you can think in an ovbiously
unused date (01-01-1500, for example) that acts as a null date. It's a
little dirty, but it would work. But in other applications every possible
date has a meaning. And if the object could be inexistent in some cases, you
have no choice: it's nil.
That's my case, and I'm forced to use a StringIndex, converting the dates to
Strings, answering an empty string if the object is nil. That's really
dirty.
Would'nt be better if magma indexes just ignore nil objects? Is it a
requirement for magma that every object from a MagmaCollection must be
present in all indexes?
I hope there is something I misunderstood and there is a more elegant
solution.

Regards
Norberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/magma/attachments/20080111/ad596b86/attachment.htm


More information about the Magma mailing list