Skip to content

Instantly share code, notes, and snippets.

@pbalduino
Created April 4, 2013 13:41
Show Gist options
  • Save pbalduino/5310415 to your computer and use it in GitHub Desktop.
Save pbalduino/5310415 to your computer and use it in GitHub Desktop.
Pre condition in Clojure
(defn foo [x]
{:pre [(> x 10)]}
(println x))
; output: 'user/foo
(foo 2)
; output: AssertionError Assert failed: (> x 10) user/foo (NO_SOURCE_FILE:1)
(foo 11)
; output: 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment