RE: General Query Framework, an updated proposal
Or, for that matter, is my fruit account before or after my meat account. Comparison only works on ordinal and higher groupings. > -Original Message- > Phillip Shelton <[EMAIL PROTECTED]> 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 > > ___ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
Re: General Query Framework, an updated proposal
Phillip Shelton <[EMAIL PROTECTED]> 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 > >[EMAIL PROTECTED]PGP key available > > ___ > > gnucash-devel mailing list > > [EMAIL PROTECTED] > > http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel > > > ___ > gnucash-devel mailing list > [EMAIL PROTECTED] > 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 [EMAIL PROTECTED]PGP key available ___ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
RE: General Query Framework, an updated proposal
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. Phill > -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 >[EMAIL PROTECTED]PGP key available > ___ > gnucash-devel mailing list > [EMAIL PROTECTED] > http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel > ___ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
Re: General Query Framework, an updated proposal
> I've been trying to implement some of the core types, and I've > realized that in my generic model there does not appear to be a way to > implement the equivalent of ACCT_MATCH_ALL. For the record, Dave and I discussed this on #gnucash earlier today and decided to depricate ACCT_MATCH_ALL. Nothing seems to use it, currently, and the model is just wrong anyways. -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 [EMAIL PROTECTED]PGP key available ___ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
Re: General Query Framework, an updated proposal
I've been trying to implement some of the core types, and I've realized that in my generic model there does not appear to be a way to implement the equivalent of ACCT_MATCH_ALL. I need to think on this. The problem is that you would add a predicate that looks something like: ("account", "guid", equals, match_all, guidlist) This would, internally, lookup the account->guid QueryAccess function for the term, and when you run it looking for splits it would obtain the split->account QueryConvert function. The problem is that I can get from "split" to "account" and lookup the account's guid, but I have no way in the predicate to know how to look up split's transaction's splitlist's account's guid, which is really what you want for a "MATCH_ALL". In fact, the predicate is being given an account, not a split. I'm not sure how to reconcile this at the moment. -derek ___ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
Re: General Query Framework, an updated proposal
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 [EMAIL PROTECTED]PGP key available ___ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel