JanetDocsPlaygroundI'm feeling luckyGitHub sign in
# will recursively flatten all indexed-like values (flatten [1 @[2 [3]] [@[4] 5]]) # => @[1 2 3 4 5] # only applies to indexed values, other values are untouched (flatten ["a" :b [:c :d] :e "f"]) # be careful: dictionaries are considered indexed since they define next (flatten {:a :b}) # however, this only applies to the top value, otherwise it remains untouched (flatten [{:a :b} {:c :d}]) # if you want only "one cycle of flatten", you want reduce (reduce array/concat @[] (pairs {:a [:b :c] :d [:e [:f]]})) # => @[:d (:e (:f)) :a (:b :c)]