mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +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 ..."
 |