Liking cljdoc? Tell your friends :D

clj-zig.fileref

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.
raw docstring

candidate-pathsclj

(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.
sourceraw docstring

resolve-and-readclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close