From 8a870c721870e09eaadfe49607a860a9ebae0812 Mon Sep 17 00:00:00 2001 From: Bob Tolbert Date: Thu, 23 Jan 2025 08:28:03 -0800 Subject: [PATCH 1/2] add examples for distinct --- examples/distinct.janet | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 examples/distinct.janet diff --git a/examples/distinct.janet b/examples/distinct.janet new file mode 100644 index 0000000..4db3f48 --- /dev/null +++ b/examples/distinct.janet @@ -0,0 +1,7 @@ +(distinct @[1 2 3 2 1]) # -> @[1 2 3] + +(distinct [1 2 3 2 1]) # -> @[1 2 3] + +(distinct "bookkeeper") # -> @[98 111 107 101 112 114] + +(sort (map string/from-bytes (distinct "bookkeeper"))) # -> @["b" "e" "k" "o" "p" "r"] \ No newline at end of file From a63ba4f312d3f11f9ab81660da245796e32fc0f7 Mon Sep 17 00:00:00 2001 From: Bob Tolbert Date: Thu, 23 Jan 2025 08:30:35 -0800 Subject: [PATCH 2/2] fix format of last example --- examples/distinct.janet | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/distinct.janet b/examples/distinct.janet index 4db3f48..efd6983 100644 --- a/examples/distinct.janet +++ b/examples/distinct.janet @@ -4,4 +4,5 @@ (distinct "bookkeeper") # -> @[98 111 107 101 112 114] -(sort (map string/from-bytes (distinct "bookkeeper"))) # -> @["b" "e" "k" "o" "p" "r"] \ No newline at end of file +(sort (map string/from-bytes + (distinct "bookkeeper"))) # -> @["b" "e" "k" "o" "p" "r"] \ No newline at end of file