Skip to content

Commit d2f7bf8

Browse files
authored
Merge pull request #266 from rwtolbert/examples_distinct
add examples for distinct
2 parents 77b7468 + a63ba4f commit d2f7bf8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/distinct.janet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(distinct @[1 2 3 2 1]) # -> @[1 2 3]
2+
3+
(distinct [1 2 3 2 1]) # -> @[1 2 3]
4+
5+
(distinct "bookkeeper") # -> @[98 111 107 101 112 114]
6+
7+
(sort (map string/from-bytes
8+
(distinct "bookkeeper"))) # -> @["b" "e" "k" "o" "p" "r"]

0 commit comments

Comments
 (0)