This commit is contained in:
Gered 2014-06-14 22:18:11 -04:00
parent b3010e23b1
commit 49519a3106

View file

@ -51,14 +51,14 @@
(cond (cond
(instance? java.util.List coll) (.indexOf coll value) (instance? java.util.List coll) (.indexOf coll value)
(string? coll) (.indexOf coll (if (char? value) (int value) value)) (string? coll) (.indexOf coll (if (char? value) (int value) value))
:else (throw (new Exception (str "'index_if' passed invalid collection type: " (type coll))))))} :else (throw (new Exception (str "'index_of' passed invalid collection type: " (type coll))))))}
"last_index_of" "last_index_of"
{:fn (fn [coll value] {:fn (fn [coll value]
(cond (cond
(instance? java.util.List coll) (.lastIndexOf coll value) (instance? java.util.List coll) (.lastIndexOf coll value)
(string? coll) (.lastIndexOf coll (if (char? value) (int value) value)) (string? coll) (.lastIndexOf coll (if (char? value) (int value) value))
:else (throw (new Exception (str "'last_index_if' passed invalid collection type: " (type coll))))))} :else (throw (new Exception (str "'last_index_of' passed invalid collection type: " (type coll))))))}
"max" "max"
{:fn (fn [& numbers] {:fn (fn [& numbers]