Skip to content

Commit d5fa463

Browse files
authored
Merge pull request #269 from rwtolbert/examples_filter
add examples for filter
2 parents d2f7bf8 + 0ecbcfc commit d5fa463

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/filter.janet

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(filter pos? [1 2 3 0 -4 5 6]) # -> @[1 2 3 5 6]
2+
3+
(filter |(> (length $) 3) ["hello" "goodbye" "hi"]) # -> @["hello" "goodbye"]
4+
5+
(filter |(< (chr "A") $) "foo01bar") # -> @[102 111 111 98 97 114]
6+
7+
(string/from-bytes ;(filter |(< (chr "A") $) "foo01bar")) # -> "foobar"

0 commit comments

Comments
 (0)