JanetDocsPlaygroundI'm feeling luckyGitHub sign in

module/expand-path



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

    (module/expand-path path template)

    Expands a path template as found in `module/paths` for 
    `module/find`. This takes in a path (the argument to require) and a 
    template string, to expand the path to a path that can be used for 
    importing files. The replacements are as follows:

    * :all: -- the value of path verbatim.

    * :@all: -- Same as :all:, but if `path` starts with the @ 
      character,
          the first path segment is replaced with a dynamic binding
          `(dyn <first path segment as keyword>)`.
              * :cur: -- the current file, or (dyn :current-file)

    * :dir: -- the directory containing the current file

    * :name: -- the name component of path, with extension if given

    * :native: -- the extension used to load natives, .so or .dll

    * :sys: -- the system path, or (dyn :syspath)


0 examplesSign in to add an example
Loading...