Skip to content

Commit 6479bd5

Browse files
authored
Merge pull request #297 from sogaiu/add-all-examples
Add more examples for all
2 parents 5734356 + 7f4ae37 commit 6479bd5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/all.janet

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@
66

77
(all truthy? [1 2 3]) # -> true
88
(all truthy? [1 2 nil]) # -> false
9+
10+
# multiple data structures can be handled
11+
(all (fn [x y] (pos? (* x y))) [-1 2] [-2 1]) # -> true
12+
13+
# predicate may not be applied to all values (e.g. 43)
14+
(all |(neg? (+ $0 $1 $2)) [-2 2] [1 -8] [0 1 43]) # -> true
15+

0 commit comments

Comments
 (0)