JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

type

core-api


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

    (type x)

    Returns the type of `x` as a keyword. `x` is one of:

    * :number
    * :nil
    * :boolean
    * :fiber
    * :string
    * :symbol
    * :keyword
    * :array
    * :tuple
    * :table
    * :struct
    * :buffer
    * :function
    * :cfunction
    * :pointer

    or another keyword for an abstract type.


3 examplesSign in to add an example
Loading...
(type (fiber/new (fn [])))
# =>
:fiber
sogaiuPlayground
(type print)
# =>
:cfunction
sogaiuPlayground
(map type [nil true 42 [] @[] {} @{} "a" @"b" 'c :d identity (fn [])])
# => @[:nil :boolean :number :tuple :array :struct :table :string :buffer :symbol :keyword :function :function]
cellularmitosisPlayground