mirror of
https://github.com/janet-lang/janet
synced 2024-11-18 06:34:48 +00:00
Update core library.
This commit is contained in:
parent
2a127af1ca
commit
3ba49ed111
@ -793,6 +793,17 @@ value, one key will be ignored."
|
|||||||
(put freqs x (if n (+ 1 n) 1)))
|
(put freqs x (if n (+ 1 n) 1)))
|
||||||
freqs)
|
freqs)
|
||||||
|
|
||||||
|
(defn interleave
|
||||||
|
"Returns an array of the first elements of each col,
|
||||||
|
then the second, etc."
|
||||||
|
[& cols]
|
||||||
|
(def res @[])
|
||||||
|
(def len (apply min 0 (mapa length cols)))
|
||||||
|
(loop [i :range [0 len]]
|
||||||
|
(loop [c :in col]
|
||||||
|
(array.push res (get c i))))
|
||||||
|
res)
|
||||||
|
|
||||||
###
|
###
|
||||||
###
|
###
|
||||||
### Pretty Printer
|
### Pretty Printer
|
||||||
|
Loading…
Reference in New Issue
Block a user