mirror of
https://github.com/janet-lang/janet
synced 2024-11-29 03:19:54 +00:00
Fix interleave
This commit is contained in:
parent
3ba49ed111
commit
d603e0eb8d
@ -798,10 +798,12 @@ value, one key will be ignored."
|
|||||||
then the second, etc."
|
then the second, etc."
|
||||||
[& cols]
|
[& cols]
|
||||||
(def res @[])
|
(def res @[])
|
||||||
(def len (apply min 0 (mapa length cols)))
|
(def ncol (length cols))
|
||||||
(loop [i :range [0 len]]
|
(when (> ncol 0)
|
||||||
(loop [c :in col]
|
(def len (apply min (mapa length cols)))
|
||||||
(array.push res (get c i))))
|
(loop [i :range [0 len]]
|
||||||
|
(loop [ci :range [0 ncol]]
|
||||||
|
(array.push res (get (get cols ci) i)))))
|
||||||
res)
|
res)
|
||||||
|
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user