We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a6d3ecf + 554bed7 commit 60c1305Copy full SHA for 60c1305
examples/mapcat.janet
@@ -0,0 +1,9 @@
1
+# consolidate with array/concat after applying identity to each
2
+(mapcat identity [[-2 -1] [0 1 2] [7 8]]) # -> @[-2 -1 0 1 2 7 8]
3
+
4
+# multiple data structures can be handled
5
+(mapcat tuple [:x :y] [-1 1]) # -> @[:x -1 :y 1]
6
7
+# function may not be applied to all values (e.g. :z)
8
+(mapcat |(tuple $0 $1 $2) [:a :b] [:x :y :z] [0 1]) # -> @[:a :x 0 :b :y 1]
9
0 commit comments