Liking cljdoc? Tell your friends :D

clj-zig.type

Normalize boundary type forms into plain data. Pure: a type form goes in, a normalized map comes out, or a diagnostic is thrown.

Scalar types are Zig keywords; compound types are vectors; a symbol names a type declared elsewhere (deftypez, defrecordz, defenumz) and resolves against the named-type registry later. For example:

:i64                  => {:kind :scalar :name :i64}
[:slice :const :u8]   => {:kind :slice :const? true
                          :of {:kind :scalar :name :u8}}
Point                 => {:kind :named :name Point}

The normalized form is the inspectable contract; it carries only structure. Scalar classification (signedness, bit width) lives in the scalars table and feeds the unsigned-return policy and the spec-time rejection of carriers FFM cannot express (:i128/:u128).

Normalize boundary type forms into plain data. Pure: a type
form goes in, a normalized map comes out, or a diagnostic is thrown.

Scalar types are Zig keywords; compound types are vectors; a symbol
names a type declared elsewhere (`deftypez`, `defrecordz`, `defenumz`)
and resolves against the named-type registry later. For example:

    :i64                  => {:kind :scalar :name :i64}
    [:slice :const :u8]   => {:kind :slice :const? true
                              :of {:kind :scalar :name :u8}}
    Point                 => {:kind :named :name Point}

The normalized form is the inspectable contract; it carries only
structure. Scalar classification (signedness, bit width) lives in the
`scalars` table and feeds the unsigned-return policy and the spec-time
rejection of carriers FFM cannot express (`:i128`/`:u128`).
raw docstring

has-carrier?clj

(has-carrier? name)

True when a scalar crosses the FFM boundary as a primitive value. Stable FFM (Java 22) carries 8/16/32/64-bit integers and 32/64-bit floats and bool; 128-bit integers and 16/80/128-bit floats have no carrier, so they are rejected at spec time. :void and :noreturn are not value carriers (a :void return carries nothing).

True when a scalar crosses the FFM boundary as a primitive value.
Stable FFM (Java 22) carries 8/16/32/64-bit integers and
32/64-bit floats and `bool`; 128-bit integers and 16/80/128-bit floats
have no carrier, so they are rejected at spec time. `:void` and
`:noreturn` are not value carriers (a `:void` return carries nothing).
sourceraw docstring

normalizeclj

(normalize form)

Normalize a boundary type form to its canonical data shape. Throws a diagnostic (ex-info) for unknown or malformed types.

Normalize a boundary type form to its canonical data shape. Throws a
diagnostic (`ex-info`) for unknown or malformed types.
sourceraw docstring

scalar-infoclj

(scalar-info name)

Classification map for a scalar keyword, or nil if it is not one.

Classification map for a scalar keyword, or nil if it is not one.
sourceraw docstring

scalarsclj

The scalar boundary types and their classification. :bits for :isize/:usize is the 64-bit value for the development target; it is platform-dependent in Zig.

The scalar boundary types and their classification.
`:bits` for `:isize`/`:usize` is the 64-bit value for the development
target; it is platform-dependent in Zig.
sourceraw docstring

unsigned-int?clj

(unsigned-int? name)

True when name is an unsigned integer scalar.

True when `name` is an unsigned integer scalar.
sourceraw docstring

void-type?clj

(void-type? t)

True when a normalized type is a :void or :noreturn scalar, which carries no value across the boundary.

True when a normalized type is a `:void` or `:noreturn` scalar, which
carries no value across the boundary.
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