(require path) path: a str returns any type
F
Evaluates the contents of a file, if it hasn't been seen before.
This function is equivalent to (load path)
, except that if the specified file
has previously been passed to a require
call in the current Runtime
, it's a
silent no-op.
When you have a complicated source hierarchy, this function can be useful to avoid accidentally loading the same source file twice.
Deduplication is based on the file which is being referred to, rather than the
literal text of the path
argument. For example, these three require
calls would
only load example.glsp
once:
(require "src/example.glsp")
(require "./src/example.glsp")
(require "src/../src/example.glsp")
In a sandboxed Runtime
, this macro is
not defined.