From fcc09d7ea943e930c76038684c0b0e7834826579 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 5 Feb 2020 21:06:39 -0600 Subject: [PATCH] Clarify docs for `some` and `all`. --- src/boot/boot.janet | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index a03440f0..6d201ba9 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -1583,14 +1583,16 @@ ret) (defn all - "Returns true if all xs are truthy, otherwise the first false or nil value." + "Returns true if all xs are truthy, otherwise the resulty of first + falsey predicate value, (pred x)." [pred xs] (var ret true) (loop [x :in xs :while ret] (set ret (pred x))) ret) (defn some - "Returns nil 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 result of the + first truthy predicate, (pred x)." [pred xs] (var ret nil) (loop [x :in xs :while (not ret)] (if-let [y (pred x)] (set ret y)))