A dispatch value is the value produced from multimethod arguments to select the implementation that should run. A dispatch function computes it; methods handle particular values. section 13.2 section 13.6
Greeting animals without classes
A greet multimethod receives an animal map. Its dispatch function returns animal.type, producing values such as "dog", "cat", or "cow". Each value selects greetDog, greetCat, or greetCow. A default method handles an unmatched value such as "horse". section 13.2
A dispatch function also:
- Defines the multimethod signature. section 13.6
- Validates the arguments before emitting a value. section 13.6
- Can emit multiple values when behavior depends on several arguments. section 13.6
