Liking cljdoc? Tell your friends :D

clj-zig.inspect

Read what a defnz Var records about its native function. The defining form leaves inspection data on the Var; these helpers read it back, so everything a developer asks about a function hangs off its Var:

(zig/source #'add)             ;; the Zig body as written
(zig/generated-source #'add)   ;; the full wrapper around it
(zig/spec #'add)               ;; the normalized boundary spec
(zig/explain #'add)            ;; the last failure, rendered

Pure reads of metadata, save for explain, which renders a recorded diagnostic for a human.

Read what a `defnz` Var records about its native function. The defining
form leaves inspection data on the Var; these helpers read it back, so
everything a developer asks about a function hangs off its Var:

    (zig/source #'add)             ;; the Zig body as written
    (zig/generated-source #'add)   ;; the full wrapper around it
    (zig/spec #'add)               ;; the normalized boundary spec
    (zig/explain #'add)            ;; the last failure, rendered

Pure reads of metadata, save for `explain`, which renders a recorded
diagnostic for a human.
raw docstring

explainclj

(explain the-var)

Render the last failed attempt for the-var as the multi-line string a developer reads, or nil when there is nothing to explain.

Render the last failed attempt for `the-var` as the multi-line string a
developer reads, or nil when there is nothing to explain.
sourceraw docstring

failed-attemptclj

(failed-attempt the-var)

The recorded data for the last failed (re)definition, or nil if the current binding is the last attempt.

The recorded data for the last failed (re)definition, or nil if the
current binding is the last attempt.
sourceraw docstring

generated-sourceclj

(generated-source the-var)

The full Zig wrapper generated around the body.

The full Zig wrapper generated around the body.
sourceraw docstring

libraryclj

(library the-var)

The path to the compiled shared library backing the function.

The path to the compiled shared library backing the function.
sourceraw docstring

signatureclj

(signature the-var)

The signature vector the function was defined with.

The signature vector the function was defined with.
sourceraw docstring

sourceclj

(source the-var)

The Zig body the function was defined with.

The Zig body the function was defined with.
sourceraw docstring

source-fileclj

(source-file the-var)

The path of the .zig file the body was loaded from, or nil for an inline body.

The path of the `.zig` file the body was loaded from, or nil for an
inline body.
sourceraw docstring

source-modeclj

(source-mode the-var)

How the body was supplied: inline (:inline), from a complete Zig file the wrapper calls (:file), or as a raw export fn (:raw).

How the body was supplied: inline (`:inline`), from a complete Zig file
the wrapper calls (`:file`), or as a raw export fn (`:raw`).
sourceraw docstring

specclj

(spec the-var)

The normalized boundary spec the function was built from.

The normalized boundary spec the function was built from.
sourceraw docstring

statusclj

(status the-var)

Whether the backing library was freshly built (:compiled) or reused from the cache (:cached).

Whether the backing library was freshly built (`:compiled`) or reused
from the cache (`:cached`).
sourceraw docstring

symbolclj

(symbol the-var)

The stable C symbol the native function is exported under.

The stable C symbol the native function is exported under.
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