Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make loop/recur match for num compat

  • Loading branch information...
commit b71e3d733b8c590eb3b0b9e8d555de4f1311a9ad 1 parent d971ab4
@richhickey authored
View
2  src/main/clojure/clojure/contrib/math.clj
@@ -104,7 +104,7 @@ Returns an exact number if the base is an exact number and the power is an integ
expt (fn [x y] [(class x) (class y)]))
(defn- expt-int [base pow]
- (loop [n pow, y 1, z base]
+ (loop [n pow, y (num 1), z base]
(let [t (bit-and n 1), n (bit-shift-right n 1)]
(cond
(zero? t) (recur n y (* z z))
View
4 src/main/clojure/clojure/contrib/pprint/cl_format.clj
@@ -834,7 +834,7 @@ Note this should only be used for the last one in the sequence"
args (init-navigator arg-list)]
(loop [count 0
args args
- last-pos -1]
+ last-pos (num -1)]
(if (and (not max-count) (= (:pos args) last-pos) (> count 1))
;; TODO get the offset in here and call format exception
(throw (RuntimeException. "%{ construct not consuming any arguments: Infinite loop!")))
@@ -880,7 +880,7 @@ Note this should only be used for the last one in the sequence"
[param-clause navigator])]
(loop [count 0
navigator navigator
- last-pos -1]
+ last-pos (num -1)]
(if (and (not max-count) (= (:pos navigator) last-pos) (> count 1))
;; TODO get the offset in here and call format exception
(throw (RuntimeException. "%@{ construct not consuming any arguments: Infinite loop!")))
Please sign in to comment.
Something went wrong with that request. Please try again.