Hubbry Logo
Predicate dispatchPredicate dispatchMain
Open search
Predicate dispatch
Community hub
Predicate dispatch
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something
Predicate dispatch
from Wikipedia

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.[1][2]

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

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

Experimental implementations have been created for Common LISP,[4][5] and for Java (JPred[2]).

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.

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
Add your contribution
Related Hubs
Contribute something
User Avatar
No comments yet.