Skip to content

Commit

Permalink
Merge pull request #234 from sogaiu/doc-import-more
Browse files Browse the repository at this point in the history
Document import search order
  • Loading branch information
bakpakin authored Oct 5, 2024
2 parents 6fbbcc3 + faff941 commit 5f8f67b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions content/docs/modules.mdz
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ more natural way.
(p/join (os/cwd) "temp")
```

By default, the following files will be searched for in order for
@code`(import foo)`:

* @code`foo.jimage`
* @code`foo.janet`
* @code`foo/init.janet`
* @code`foo.<native-extension>`

where @code`<native-extension>` is the file extension for shared
objects / libraries for the current platform (e.g. `dll` for Windows,
`dylib` for macos, and `so` for other unix-likes). This is a
"first-match wins" arrangement so at most one file will be imported.

## Custom loaders (@code`module/paths` and @code`module/loaders`)

The @code`module/paths` and @code`module/loaders` data structures
Expand Down

0 comments on commit 5f8f67b

Please sign in to comment.