From 7f4ae3700f6d74b567ca74f875a69f4111c4ed9f Mon Sep 17 00:00:00 2001 From: sogaiu <983021772@users.noreply.github.com> Date: Thu, 10 Apr 2025 18:29:06 +0900 Subject: [PATCH] Add more examples for all --- examples/all.janet | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/all.janet b/examples/all.janet index 71435633..67442a89 100644 --- a/examples/all.janet +++ b/examples/all.janet @@ -6,3 +6,10 @@ (all truthy? [1 2 3]) # -> true (all truthy? [1 2 nil]) # -> false + +# multiple data structures can be handled +(all (fn [x y] (pos? (* x y))) [-1 2] [-2 1]) # -> true + +# predicate may not be applied to all values (e.g. 43) +(all |(neg? (+ $0 $1 $2)) [-2 2] [1 -8] [0 1 43]) # -> true +