Skip to content

Instantly share code, notes, and snippets.

@maacl
Created March 30, 2011 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maacl/894901 to your computer and use it in GitHub Desktop.
Save maacl/894901 to your computer and use it in GitHub Desktop.
Example from page 186 in Practical Clojure
(defprotocol Payroll
(paycheck [emp hrs]))
(defrecord HourlyEmployee [name rate]
Payroll
(paycheck [hrs] (* rate hrs)))
Fails with:
java.lang.IllegalArgumentException: Can't define method not in interfaces: paycheck (NO_SOURCE_FILE:13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment