It would have been nice of you to shortly describe, what Predicate Dispatch is. At least according to what Google tells me, Predicate Dispatch seems to be (object/class) method dispatch based on functions ("predicates") that indicate which method is the most appropriate to dispatch to.
The Perl5 dispatch mechanism has only single dispatch based on the object/class type, and Perl6 will have multimethod dispatch, based on all parameter types, as far as I understand. Implementing and (much more so) sensibly declaring Predicate Dispatch methods is something I haven't seen, but the most likely candidate for an implementation is Damian Conways book, ?Object Oriented Perl?.
| [reply] |
| [reply] |
So, basically what you're saying is that you want the ability to specify when a certain method should be called versus some other method at runtime. Sounds like a candidate for AUTOLOAD, but you're going to be doing a lot of book-keeping yourself. Also, you need to figure out the syntax for how you specify your predicates. Attributes might help you here, but they're not easy to work with.
In other words, you figure out the API you want to use and we'll help you from there. Sounds like a great project. Good luck!
| [reply] |