Yeah Dan, I agree. That's why I said to ignore them given your prior statements. I admitted my suggestion weren't optimal or good, just offering alternative ideas.
Also, I haven't looked in awhile, but I felt like this was the type of syntax that dm-ambition was suggesting. Though, not on Hash. My actual/ final suggestion was not to monkey-patch Hash, but to create a Condition, which was mostly a hash (as in the gist I linked to). Tony On Oct 30, 2:38 pm, "Dan Kubb (dkubb)" <dan.k...@gmail.com> wrote: > Thanatos, > > > Oh, then yeah, this seems like a perfect way to help that out! Ignore > > my DSL suggestions. > > In the past there's been alot of discussion about alternate API > interfaces for queries. The problem with most of the suggestions is > that they typically address only one part of what the API would need. > For something to be a true improvement, it would need to support AND, > OR and NOT operations, with and without nesting. > > I think monkey patching Hash and other ruby-core primitives is > something we should remove from consideration. It's messy, not > "polite" ruby, and probably not the optimal API anyway. > > I would hate to see stuff like this associated with DataMapper: > > ({ :name => 'Dan Kubb' } | { :name => 'Thanatos' }) & { :active => > true } > > Our focus has always been on providing a nice, clean consistent API, > and I think code like the above is not representative of what we are > trying to do. > > Plus Imagine how it'd look with deeper nesting, and negation isn't > handled elegantly (how would you negate a whole condition branch for > example?). Ted's Sugar Glider API should address all of these > concerns and more, without having to resort to writing "line noise" > for our queries :) > > -- > > Dan > (dkubb) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to datamapper@googlegroups.com To unsubscribe from this group, send email to datamapper+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---