Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created December 15, 2010 19:59
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 amalloy/fcb633325567f677f3bd to your computer and use it in GitHub Desktop.
Save amalloy/fcb633325567f677f3bd to your computer and use it in GitHub Desktop.
user=> (defrecord Obj [x] clojure.lang.IDeref (deref [this] (/ 1 0)))
user.Obj
user=> (Obj. 1)
#:user.Obj{:x 1}
user=> (deftype Obj [x] clojure.lang.IDeref (deref [this] (/ 1 0)))
user.Obj
user=> (Obj. 1)
java.lang.ArithmeticException: Divide by zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment