Created
September 26, 2011 20:58
-
-
Save belun/1243395 to your computer and use it in GitHub Desktop.
auto-vals inside protocol from record
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
user=> (defprotocol Fun-Time (drinky-drinky [_])) | |
Fun-Time | |
user=> (defrecord Someone [nick-name preffered-drink] Fun-Time (drinky-drinky [_] (str nick-name " (having " preffered-drink ") : uuumm"))) | |
user.Someone | |
user=> (def dude (Someone. "belun" "daiquiri")) | |
#'user/dude | |
user=> (drinky-drinky dude) | |
"belun (having daiquiri) : uuumm" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment