Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Predicate dispatch
Technique in computer programming

In computer programming, predicate dispatch is a generalisation of multiple dispatch ("multimethods") that allows the method to call to be selected at runtime based on arbitrary decidable logical predicates and/or pattern matching attached to a method declaration.

Raku supports predicate dispatch using "where" clauses that can execute arbitrary code against any function or method parameter.

Julia has a package for it with PatternDispatch.jl but otherwise natively supports multiple dispatch.

Experimental implementations have been created for Common LISP, and for Java (JPred).

It allows open extension of previously declared methods at a fine-grained level, but multiple extensions with identical or overlapping predicates created by different developers may interfere with each other in unanticipated ways. In this respect it is similar to aspect-oriented programming.

We don't have any images related to Predicate dispatch yet.
We don't have any YouTube videos related to Predicate dispatch yet.
We don't have any PDF documents related to Predicate dispatch yet.
We don't have any Books related to Predicate dispatch yet.
We don't have any archived web articles related to Predicate dispatch yet.

References

  1. Millstein, T. Practical Predicate Dispatch (PDF). OOPSLA '05. http://web.cs.ucla.edu/~todd/research/oopsla04.pdf

  2. Millstein, T.; Frost, C.; Ryder, J.; Warth, A. (2009). "Expressive and modular predicate dispatch for Java". ACM Transactions on Programming Languages and Systems. 31 (2): 1. CiteSeerX 10.1.1.212.4268. doi:10.1145/1462166.1462168. S2CID 2150617. /wiki/CiteSeerX_(identifier)

  3. "class Signature". Retrieved 2020-07-07. https://docs.raku.org/type/Signature#index-entry-where_clause

  4. "Predicate Dispatching in Common Lisp Object System" (PDF). ftp://publications.ai.mit.edu/ai-publications/2001/AITR-2001-006.pdf

  5. "pcostanza/filtered-functions". GitHub. Retrieved 2016-04-07. https://github.com/pcostanza/filtered-functions

  6. Millstein, T.; Frost, C.; Ryder, J.; Warth, A. (2009). "Expressive and modular predicate dispatch for Java". ACM Transactions on Programming Languages and Systems. 31 (2): 1. CiteSeerX 10.1.1.212.4268. doi:10.1145/1462166.1462168. S2CID 2150617. /wiki/CiteSeerX_(identifier)