Changes for clojure.core/defprotocol

pjlegato on Sun, 30 Sep 2012
(defprotocol Fly
  "A simple protocol for flying"
  (fly [this] "Method to fly"))

(defrecord Bird [name species]
  Fly
  (fly [this] (str (:name this) " flies...")))

(extends? Fly Bird)
-> true

(def crow (Bird. "Crow" "Corvus corax"))

(fly crow)
-> "Crow flies..."
TimMc on Tue, 05 Apr 2011
(defprotocol Fly
  "A simple protocol for flying"
  (fly [this] "Method to fly"))

(defrecord Bird [nom species]
  Fly
  (fly [this] (str (:nom this) " flies...")))

(extends? Fly Bird)
-> true

(def crow (Bird. "Crow" "Corvus corax"))

(fly crow)
-> "Crow flies..."
maacl on Wed, 30 Mar 2011
(defprotocol Fly
  "A simple protocol for flying"
  (fly [this] "Method to fly"))

(defrecord Bird [nom species]
  Fly
  (fly [this] (str (:nom this) " flies...")))

(def crow (Bird. "Crow" "Corvus corax"))

(fly crow)
-> "Crow flies..."
boxie on Mon, 15 Nov 2010
(defprotocol Fly
  "A simple protocol for flying"
  (fly [this] "Method to fly"))

(defrecord Bird [nom species]
  Fly
  (fly [this] (str (:nom this) " flies..."))

(def crow (Bird. "Crow" "Corvus corax"))

(fly crow)
-> "Crow flies..."
Kototama on Thu, 07 Oct 2010
;; from Stuart Halloway's examples:

(defprotocol AProtocol
  "A doc string for AProtocol abstraction"
  (bar [a b] "bar docs")
  (baz [a] "baz docs"))
Kototama on Thu, 07 Oct 2010
;; from Stuart Halloway:

(defprotocol AProtocol
  "A doc string for AProtocol abstraction"
  (bar [a b] "bar docs")
  (baz [a] "baz docs"))
Kototama on Thu, 07 Oct 2010
;; from Stuart Halloway:

(defprotocol AProtocol
"A doc string for AProtocol abstraction"
(bar [a b] "bar docs")
(baz [a] "baz docs"))
Kototama on Thu, 07 Oct 2010
;; from Stuart Hallow:

(defprotocol AProtocol
"A doc string for AProtocol abstraction"
(bar [a b] "bar docs")
(baz [a] "baz docs"))