Created
March 30, 2011 18:04
-
-
Save maacl/894901 to your computer and use it in GitHub Desktop.
Example from page 186 in Practical Clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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