mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
16 lines
233 B
Clojure
16 lines
233 B
Clojure
(defprotocol ISound (sound []))
|
|
|
|
(deftype Cat []
|
|
ISound
|
|
(sound [_] "Meow!"))
|
|
|
|
(deftype Dog []
|
|
ISound
|
|
(sound [_] "Woof!"))
|
|
|
|
(extend-type default
|
|
ISound
|
|
(sound [_] "... silence ..."))
|
|
|
|
(sound 1) ;; => "... silence ..."
|