Skip to content

Commit eda9bed

Browse files
committed
add return values
1 parent ba981d4 commit eda9bed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/eachk.janet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# keys for tuple/array are 0-based index
22
# prints 0 1 2 3 4
3-
(eachk i [:a :b :c :d :e] (prin i " "))
3+
(eachk i [:a :b :c :d :e] (prin i " ")) # -> nil
44

55
# prints 0 1 2 3 4
6-
(eachk i @["a" "b" "c" "d" "e"] (prin i " "))
6+
(eachk i @["a" "b" "c" "d" "e"] (prin i " ")) # -> nil
77

88
# prints keys in table/struct in an unspecified order
99
# prints :b :a
10-
(eachk k {:a 1 :b 2} (prinf "%v " k))
10+
(eachk k {:a 1 :b 2} (prinf "%v " k)) # -> nil
1111

1212
# prints :foo :bar
13-
(eachk k @{:foo "A" :bar "B"} (prinf "%v " k))
13+
(eachk k @{:foo "A" :bar "B"} (prinf "%v " k)) # -> nil

0 commit comments

Comments
 (0)