diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2011-02-21 23:28:46 -0500 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2011-02-21 23:28:46 -0500 |
| commit | d6c8d8ab019721ba47a289de97c95e9786dd5ded (patch) | |
| tree | fbafe9199d175250477f3881f5b5e5808df81df8 /src/utils.clj | |
| parent | f2525430e94460085f369a526986b2b0a176b99f (diff) | |
sostler add favorite to frontpage
Diffstat (limited to 'src/utils.clj')
| -rwxr-xr-x | src/utils.clj | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.clj b/src/utils.clj index eb89cf1..22a0b5d 100755 --- a/src/utils.clj +++ b/src/utils.clj @@ -321,6 +321,11 @@ ;; Parsing +(defn to-int [x] + (cond (integer? x) x + (string? x) (Integer/parseInt x) + :else (throw (Exception. (str "Invalid argument " x))))) + (defn maybe-parse-int ([s] (maybe-parse-int s 0)) ([s a] |
