Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bugfix: Inequalities with multiple arguments #12

Closed
wants to merge 1 commit into from

2 participants

@ejlo

Hi, I'm a clojure noob, so please forgive me if I'm doing it wrong :)

I noticed that there was a problem with inequalities with more than two arguments, like (> 2 0 1), giving the wrong answer. It seems it was caused by this patch.

@swannodette swannodette closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2011
  1. @ejlo
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/clj/cljs/core.clj
View
10 src/clj/cljs/core.clj
@@ -75,27 +75,27 @@
(defmacro <
([x] true)
([x y] (list 'js* "(~{} < ~{})" x y))
- ([x y & more] `(< (< ~x ~y) ~@more)))
+ ([x y & more] `(and (< ~x ~y) (< ~y ~@more))))
(defmacro <=
([x] true)
([x y] (list 'js* "(~{} <= ~{})" x y))
- ([x y & more] `(<= (<= ~x ~y) ~@more)))
+ ([x y & more] `(and (<= ~x ~y) (<= ~y ~@more))))
(defmacro >
([x] true)
([x y] (list 'js* "(~{} > ~{})" x y))
- ([x y & more] `(> (> ~x ~y) ~@more)))
+ ([x y & more] `(and (> ~x ~y) (> ~y ~@more))))
(defmacro >=
([x] true)
([x y] (list 'js* "(~{} >= ~{})" x y))
- ([x y & more] `(>= (>= ~x ~y) ~@more)))
+ ([x y & more] `(and (>= ~x ~y) (>= ~y ~@more))))
(defmacro ==
([x] true)
([x y] (list 'js* "(~{} === ~{})" x y))
- ([x y & more] `(== (== ~x ~y) ~@more)))
+ ([x y & more] `(and (== ~x ~y) (== ~y ~@more))))
(defmacro dec [x]
`(- ~x 1))
Something went wrong with that request. Please try again.