JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

table

core-api


    cfunction
    src/core/corelib.c on line 488, column 1

    (table & ksvs)

    Creates and returns a new table from a variadic number of keys and 
    values `ksvs`, k1, v1, k2, v2, k3, v3, ... If `ksvs` has an odd 
    number of elements, an error will be thrown.


3 examplesSign in to add an example
Loading...
(def kvpairs [[:x 1] [:y 2]])

(table ;(flatten kvpairs)) => @{:x 1 :y 2}
yumaikasPlayground
(table ;(kvs (struct :a 1 :b 2)))
# => @{:a 1 :b 2}
sogaiuPlayground
(table ;[:a 1 :b 2 :c 3])
# => @{:a 1 :b 2 :c 3}
sogaiuPlayground