add Clojure and its dialects to /samples

This commit is contained in:
Hoàng Minh Thắng
2013-04-15 13:57:56 +07:00
parent b68732f0c7
commit 3bbeea3682
7 changed files with 98 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
(defprotocol ISound (sound []))
(deftype Cat []
ISound
(sound [_] "Meow!"))
(deftype Dog []
ISound
(sound [_] "Woof!"))
(extend-type default
ISound
(sound [_] "... silence ..."))
(sound 1) ;; => "... silence ..."