Predicate dispatch
Polymorphism |
---|
Ad hoc polymorphism |
Parametric polymorphism |
Subtyping |
In
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
).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
- ^ Millstein, T. Practical Predicate Dispatch (PDF). OOPSLA '05.
- ^ S2CID 2150617.
- ^ "class Signature". Retrieved 2020-07-07.
- ^ "Predicate Dispatching in Common Lisp Object System" (PDF).
- ^ "pcostanza/filtered-functions". GitHub. Retrieved 2016-04-07.
External links