Skip to content

Instantly share code, notes, and snippets.

@spoon16
Last active December 17, 2015 06:19
Show Gist options
  • Save spoon16/5564170 to your computer and use it in GitHub Desktop.
Save spoon16/5564170 to your computer and use it in GitHub Desktop.
Trying to figure out why line 13 is throwing an `ArityException` instead of yielding `"hello world"`
(defn slice
([]
(slice "hello world"))
([v]
(-slice v)))
(defprotocol Pizza
(-slice [this]))
(extend-type String
Pizza
(-slice [this] (do this)))
(slice "works") ;; works
(slice) ;; hello world
@spoon16
Copy link
Author

spoon16 commented May 13, 2013

Fixed with @gfredericks help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment