JanetDocsPlaygroundI'm feeling luckyGitHub sign in

type



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

    (type x)

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

    * :nil

    * :boolean

    * :number

    * :array

    * :tuple

    * :table

    * :struct

    * :string

    * :buffer

    * :symbol

    * :keyword

    * :function

    * :cfunction

    * :fiber

    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