27
This commit is contained in:
parent
ce7411159d
commit
5674c49c3a
1 changed files with 4 additions and 4 deletions
|
|
@ -26,19 +26,19 @@
|
||||||
|
|
||||||
(meditations
|
(meditations
|
||||||
"A multimethod takes one or more arguments to dispatch on"
|
"A multimethod takes one or more arguments to dispatch on"
|
||||||
(= __
|
(= "Hello, World!"
|
||||||
(multimethod-without-args :first))
|
(multimethod-without-args :first))
|
||||||
|
|
||||||
"Though it can be ignored and represented by _ in defmethods"
|
"Though it can be ignored and represented by _ in defmethods"
|
||||||
(= __
|
(= "Hello there"
|
||||||
(multimethod-without-args :second))
|
(multimethod-without-args :second))
|
||||||
|
|
||||||
"Alternatively, we can use the arguments in defmethods"
|
"Alternatively, we can use the arguments in defmethods"
|
||||||
(= __
|
(= 1
|
||||||
(multimethod-with-args :path-one {:first-opt 1
|
(multimethod-with-args :path-one {:first-opt 1
|
||||||
:second-opt 2}))
|
:second-opt 2}))
|
||||||
|
|
||||||
"This allows us to do something different in each method implementation"
|
"This allows us to do something different in each method implementation"
|
||||||
(= __
|
(= 6
|
||||||
(multimethod-with-args :path-two {:first-opt 1
|
(multimethod-with-args :path-two {:first-opt 1
|
||||||
:second-opt [0 1 2]})))
|
:second-opt [0 1 2]})))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue