JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

partition

core-api


    function
    boot.janet on line 2142, column 1

    (partition n x)

    Partition the values of `x` into tuples of size `n`. Returns a new 
    array.

    `n` should be a non-negative integer.

    `x` can be a bytes, indexed, fiber, or abstract type with suitable 
    `get` and `next` methods.


1 exampleSign in to add an example
Loading...
(partition 2 [:a 1 :b 2 :c 3])
# => @[(:a 1) (:b 2) (:c 3)]
sogaiuPlayground