JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

import

core-api


    macro
    boot.janet on line 3183, column 1

    (import path & args)

    Import a module. First requires the module, and then merges its 
    symbols into the current environment, prepending a given prefix as 
    needed. (use the :as or :prefix option to set a prefix). If no 
    prefix is provided, use the name of the module as a prefix. One can 
    also use "`:export true`" to re-export the imported symbols. If 
    "`:exit true`" is given as an argument, any errors encountered at 
    the top level in the module will cause `(os/exit 1)` to be called. 
    Dynamic bindings will NOT be imported. Use :fresh with a truthy 
    value to bypass the module cache. Use `:only [foo bar baz]` to only 
    import select bindings into the current environment.


2 examplesSign in to add an example
Loading...
# :as sets a /

(import /deeper/inside :prefix "" :export true)
# @{_ @{:value <cycle 0>} cat @{:private false}}
(import /deeper/inside :as "" :export true)
# @{/cat @{:private false} _ @{:value <cycle 0>} cat @{:private false}}

veqqqPlayground
In order to use :fresh, write:
(import path :fresh true)
SaikyunPlayground