General Query Framework, an updated proposal

Derek Atkins warlord@MIT.EDU
30 Jan 2002 23:52:05 -0500


Phillip Shelton <shelton@usq.edu.au> writes:

> Would having your `does this object match this predicate' return - for under
> zero for true and + for above work? ... Oh, a predicate is not an object is
> it.

Right.  That's the problem.  In a few cases code can be shared, but
honestly in many cases it can't.  Adding the extra function is easier.
For example, how do you "compare" guid's or "booleans" for anything
other than equality?

> Phill

-derek

> > -----Original Message-----
> >
> > Unfortunately I forgot to include some of the "sort-by" functionality.
> > I need to go back and see how that's going to fit in.  I completely
> > missed the fact that "does this object match this predicate" is not
> > the same code as "does this object come before this other objects of
> > the same type".
> > 
> > I'd like to try to re-use code as much as possible, but I think I'm
> > going to need yet another function for core types to return a
> > comparrison.  I think this prototype would look something like:
> > 
> >         int (*QueryCompare) (gpointer a, gpointer b,
> >                              gint compare_options, 
> > QueryAccess get_fcn);
> > 
> > This would let you say something like:
> >         sort-by trans->entered_date (DATE_ROUNDED)
> > 
> > Comments?
> > 
> > -derek
> > 
> > -- 
> >        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
> >        Member, MIT Student Information Processing Board  (SIPB)
> >        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
> >        warlord@MIT.EDU                        PGP key available
> > _______________________________________________
> > gnucash-devel mailing list
> > gnucash-devel@lists.gnumatic.com
> > http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
> > 
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel@lists.gnumatic.com
> http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available