How to create a multi method in Clojure

preview_player
Показать описание
Using multi-methods in Clojure is a great way to implement a function that can have multiple implementations depending on the data you pass to it. Heres how to create a multi-method!
Рекомендации по теме
Комментарии
Автор

Great job! Next level is showcasing *derive* - making hierarchy.

eugenej.
Автор

Good explanation. In Calva we actually don't need to print output evaluate the form will print the output into the editor.

MohammodnazmuSakiB
Автор

Managing a combination of things from different dimensions can be thought of as navigating a coordinate system. Dimensions, in this context, refer to user-name (x-axis) and contact-method (y-axis). Multi-methods allow us to combine items from each dimension, much like online car configurators or MacBook product variants based on memory specs. If the x-axis consists of "actionable things" (verbs), we can add another dimension depending on whether the action's has side effects (write) or not (read). This also corresponds to the Command-Query Responsibility Segregation (CQRS), where dimension 1 represents user-name, dimension 2, 3 query/command, respectively.

TJ-hsqm
Автор

defn vs defmethod whats teh difference?

smblog