1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-28 17:30:31 +00:00
This commit is contained in:
Calvin Rose 2020-01-25 12:08:43 -06:00
parent 6f9c9879ca
commit f7b7c83264

View File

@ -1589,7 +1589,7 @@
ret) ret)
(defn some (defn some
"Returns false if all xs are false or nil, otherwise returns the first true value." "Returns nil if all xs are false or nil, otherwise returns the first true value."
[pred xs] [pred xs]
(var ret nil) (var ret nil)
(loop [x :in xs :while (not ret)] (if-let [y (pred x)] (set ret y))) (loop [x :in xs :while (not ret)] (if-let [y (pred x)] (set ret y)))