Resolve and read an external .zig source file named by a {:zig/file ...} descriptor (imperative shell). Resolution prefers a path next to
the defining Clojure source file, then the current directory, then a
classpath resource, matching what a Clojure developer expects from a
sibling file and from io/resource.
candidate-paths is pure path arithmetic; resolve-and-read touches
the filesystem and the classpath.
Resolve and read an external `.zig` source file named by a `{:zig/file
...}` descriptor (imperative shell). Resolution prefers a path next to
the defining Clojure source file, then the current directory, then a
classpath resource, matching what a Clojure developer expects from a
sibling file and from `io/resource`.
`candidate-paths` is pure path arithmetic; `resolve-and-read` touches
the filesystem and the classpath.(candidate-paths defining-file rel)The ordered filesystem paths to try for rel, given the defining
Clojure source file (its *file*, or nil / "NO_SOURCE_PATH" at the
REPL). An absolute rel is used as-is; a relative rel resolves first
against the defining file's directory, then against the current
directory. Pure: builds path strings, reads no filesystem.
The ordered filesystem paths to try for `rel`, given the defining Clojure source file (its `*file*`, or nil / "NO_SOURCE_PATH" at the REPL). An absolute `rel` is used as-is; a relative `rel` resolves first against the defining file's directory, then against the current directory. Pure: builds path strings, reads no filesystem.
(resolve-and-read defining-file rel)Read the text of the Zig source file rel, trying the filesystem
candidates first, then the classpath. Returns {:text <content> :path <resolved>}. Throws a :clj-zig/zig-file-not-found diagnostic listing
what was tried.
Read the text of the Zig source file `rel`, trying the filesystem
candidates first, then the classpath. Returns `{:text <content> :path
<resolved>}`. Throws a `:clj-zig/zig-file-not-found` diagnostic listing
what was tried.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |