JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

module/expand-path

core-api


    cfunction
    src/core/corelib.c on line 109, 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 directory portion, if any, of (dyn :current-file)

    * :dir: -- the directory portion, if any, of the path argument

    * :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...