I know that multimethods are often dispatches based on class, but is there a way to dispatch based on an interface which is implemented instead?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Multimethods allow you to specify your own dispatch function. So you can dispatch based on any predicate! The following code dispatches based on the interface implemented by the argument: