Skip to content

Instantly share code, notes, and snippets.

@rockBreaker
Created September 27, 2017 16:40
Show Gist options
  • Save rockBreaker/2349912a814937cf600ffee0f1e749c0 to your computer and use it in GitHub Desktop.
Save rockBreaker/2349912a814937cf600ffee0f1e749c0 to your computer and use it in GitHub Desktop.
(defn parse-number
"Reads a number from a string. Returns nil if not a number."
[s]
(if (re-find #"^-?\d+\.?\d*$" s)
(read-string s)))
@rockBreaker
Copy link
Author

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