From 9aa1b9c7408b672073db8a165ea312acab0697d2 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Sat, 5 Dec 2020 16:02:36 +0900 Subject: [PATCH 1/2] Clarify description of keep --- 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 0b867a62..7a0f21a8 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -945,8 +945,10 @@ counter) (defn keep - `Given a predicate, take only elements from an array or tuple for - which (pred element) is truthy. Returns a new array of truthy predicate results.` + ``Given a predicate `pred`, return a new array containing the truthy results + of applying `pred` to each element in the indexed collection `ind`. This is + different to `filter` which returns an array of the original elements where + the predicate is truthy.`` [pred ind] (def res @[]) (each item ind From 7c1a52ae65f7cc6ca3de511233a9c83484db3f94 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Sat, 5 Dec 2020 16:43:44 +0900 Subject: [PATCH 2/2] Use 'different from' in preference to 'different to' --- src/boot/boot.janet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 7a0f21a8..472c8055 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -947,7 +947,7 @@ (defn keep ``Given a predicate `pred`, return a new array containing the truthy results of applying `pred` to each element in the indexed collection `ind`. This is - different to `filter` which returns an array of the original elements where + different from `filter` which returns an array of the original elements where the predicate is truthy.`` [pred ind] (def res @[])