MichaelDrogalis/dire — pull request #17 by dparis (2013-10-29 06:06:14+00:00)
Title: Slingshot handler support

Resubmitting PR from #16, this time against the develop branch.

All changes agreed upon in #16 have been applied. Sorry I didn't have time to mess around with rebasing my commits, I didn't want to deal with messing things up on GH tonight.

I made the change to throw+ a custom exception from the catch clause within the predicate selector application multimethod. There's a new test case for that circumstance. Works great, and necessary I think, since once I made the chance it broke a couple of other tests where the predicate application was causing an exception and it was being masked entirely. Going forward, it may be a good idea to write up some caveats about using predicate matchers, since they need to be carefully designed to handle pretty much any object type.

I actually think that's a pretty compelling reason to continue working towards being able to specify a priority for matchers. Having more control over the order selectors are applied would allow you to maneuver around predicate selectors, etc, in cases where you didn't want to write them to handle everything under the sun.

For posterity:

1. We still have yet to work out a way to specify the priority of selector matching.
2. There may still be some unintuitive behavior when throwing exceptions from within exception handlers. I haven't had time to look into this, but I'm hoping to later in the week since it affects the project I'm working on.

Keep me posted about what you'd like to do next @MichaelDrogalis.