Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Created September 14, 2012 14:51
Show Gist options
  • Select an option

  • Save bouzuya/3722379 to your computer and use it in GitHub Desktop.

Select an option

Save bouzuya/3722379 to your computer and use it in GitHub Desktop.
(defn str-to-int
[s]
{:pre [(string? s)]
:post [(number? %)]}
(Integer/parseInt s))
(str-to-int 10) ; java.lang.AssertionError
(str-to-int "10") ; => 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment