Skip to content

Commit

Permalink
generalize > and < per Raynes
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrestivo committed May 8, 2012
1 parent 006801e commit 5633cc8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/noir/validation.clj
Expand Up @@ -57,12 +57,18 @@
false)))


(defn greater-than-zero?
"Returns true if the string represents a positive number."
[v]
(defn greater-than?
"Returns true if the string represents a number > given."
[v n]
(and (valid-number? v)
(> (Long/parseLong v) 0)))
(> (Long/parseLong v) n)))


(defn less-than?
"Returns true if the string represents a number < given."
[v n]
(and (valid-number? v)
(> (Long/parseLong v) n)))

(declare ^:dynamic *errors*)

Expand Down

0 comments on commit 5633cc8

Please sign in to comment.