Skip to content

Keyword: import

Pebaz edited this page May 29, 2019 · 2 revisions

Description

Imports any LambdaCore file. Can be an absolute path or a relative path. Relative paths are relative to the directory that LambdaCore was run from.

Imported files are run and their symbol table appended to the current symbol table.

Usage

(import "examples/calc.lcore")
(import "../../../some.lcore")
(import "C:/Program Files/SOME-FOLDER/hello.lcore")

:: hi.lcore
(defn 'hello [] '[
    (print "HELLO")
])

:: Some-other-file.lcore
(loop 'i 3 '[
    (import "hi.lcore")
    (hello)  :: Prints "HELLO" each iteration
])

(hello)  :: No longer in scope.
Clone this wiki locally