Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Module Reference

Reference pages list the functions and types in each runtime module. Start with the standard library overview to choose a type or find a function for a particular task.

The x2c C API collects the stable x2c_* entry points used by generated code, native callers, and compiler setup.

Modules

ModuleDescription
lib/array.xdynamic contiguous arrays of Var elements.
lib/atom.xcanonical exact names.
lib/block.xchecked dynamic storage for fixed-width elements.
lib/buffer.xgrowable text buffer with indentation support.
lib/common.xthe shared Var union and operations used by every module.
lib/context.xbounded runtime state and value export.
lib/dispatch.xtyped descriptors for runtime Var behavior.
lib/error.xhandler stack and accumulated errors.
lib/exception.xtransfer frames for x2c Error unwinding and cleanup.
lib/file.xFile I/O operations and stream handling.
lib/func.xgeneric native function binding.
lib/iter.xsingle-pass pull iterators.
lib/lib.xdisjoint sets with union-find.
lib/lisp.xthe Lisp runtime: reader, session, and evaluator.
lib/list-selectors.xoptional compound List selectors.
lib/list.xlinked list with Var elements.
lib/logger.xowned structured event delivery.
lib/map.xhash table mapping Var keys to Var values.
lib/match-recursive.xoptional reference matcher.
lib/match.xpattern matching and transformation utilities for lists.
lib/mutex.xshared mutable-state coordination.
lib/scope.xmemory allocation scope management.
lib/split.xString field splitting and repeatable typed cursors.
lib/string-classify.xbyte classification for canonical strings.
lib/string-number.xnumeric parsing from canonical byte strings.
lib/string.xcanonical byte strings and core text operations.
lib/symbol.ximmediate encoded names.
lib/symbolset.ximmutable ordered sets of compact Symbols.
lib/thread.xContext-backed native worker threads.
lib/typed-array.xpacked typed Arrays generated from shared methods.
lib/typed-list.xtyped cons chains generated from typed methods.
lib/typed-map.xtyped Maps generated from shared storage.
lib/var.xvariant type for dynamic typing.
lib/varconvert.xVar numeric conversion policy.
lib/varops.xboxed Var operators, updates, and truthiness.

Optional x2c modules

These modules ship with x2c but are not loaded by the standard prelude. Include one explicitly to use its declarations.

  • lib/list-selectors.x - Compound selectors beyond caar, cadr, cddr, and caddr; explicitly include list-selectors.x to use them.
  • lib/match-recursive.x - Readable recursive Match reference; explicitly include match-recursive.x for differential testing.
  • lib/typed-array.x - Packed typed storage with a raw native bracket; explicitly include typed-array.x to use it.
  • lib/typed-list.x - Typed views over canonical List cells; explicitly include typed-list.x to use them.
  • lib/typed-map.x - Typed maps over native numeric or canonical String fields; explicitly include typed-map.x to use them.

Runtime-internal

These modules implement the runtime and are not public APIs.

  • lib/cmath.x - C99 <math.h> prototypes, declared so a Var argument unboxes at a math call; the unit still includes <math.h>.
  • lib/error_init.x - Type-owned initialization shim that preserves Error’s pre-initialization boundary.
  • lib/lisp-machine.x - Private compile-time Lisp wordcode decoder.
  • lib/machine.x - Shared Match and Lisp wordcode, builder, and execution-state definitions.
  • lib/match-machine.x - Private Match wordcode decoder.
  • lib/pool.x - Nested interning pools that back canonical String and List identity.
  • lib/protocols.x - The built-in Block, Iter, and Var protocol declarations used to generate runtime dispatch adapters.
  • lib/scan.x - Allocation-free character scanners used by the tokenizer.
  • lib/thread-state.x - Native pthread-key storage for per-thread runtime state.
  • lib/tokenizer.x - Token stream used by the compiler and the Lisp reader.

Declared but not defined

These prototypes reach the generated headers, but no runtime source defines them. Calling one fails at link time.

  • ArrayChar.capacity - declared in lib/typed-array.x
  • ArrayChar.clear - declared in lib/typed-array.x
  • ArrayChar.free - declared in lib/typed-array.x
  • ArrayChar.len - declared in lib/typed-array.x
  • ArrayChar.pop - declared in lib/typed-array.x
  • ArrayChar.truncate - declared in lib/typed-array.x
  • ArrayChar.truth - declared in lib/typed-array.x
  • ArrayDbl.capacity - declared in lib/typed-array.x
  • ArrayDbl.clear - declared in lib/typed-array.x
  • ArrayDbl.free - declared in lib/typed-array.x
  • ArrayDbl.len - declared in lib/typed-array.x
  • ArrayDbl.pop - declared in lib/typed-array.x
  • ArrayDbl.truncate - declared in lib/typed-array.x
  • ArrayDbl.truth - declared in lib/typed-array.x
  • ArrayFloat.capacity - declared in lib/typed-array.x
  • ArrayFloat.clear - declared in lib/typed-array.x
  • ArrayFloat.free - declared in lib/typed-array.x
  • ArrayFloat.len - declared in lib/typed-array.x
  • ArrayFloat.pop - declared in lib/typed-array.x
  • ArrayFloat.truncate - declared in lib/typed-array.x
  • ArrayFloat.truth - declared in lib/typed-array.x
  • ArrayInt.capacity - declared in lib/typed-array.x
  • ArrayInt.clear - declared in lib/typed-array.x
  • ArrayInt.free - declared in lib/typed-array.x
  • ArrayInt.len - declared in lib/typed-array.x
  • ArrayInt.pop - declared in lib/typed-array.x
  • ArrayInt.truncate - declared in lib/typed-array.x
  • ArrayInt.truth - declared in lib/typed-array.x
  • ArrayLong.capacity - declared in lib/typed-array.x
  • ArrayLong.clear - declared in lib/typed-array.x
  • ArrayLong.free - declared in lib/typed-array.x
  • ArrayLong.len - declared in lib/typed-array.x
  • ArrayLong.pop - declared in lib/typed-array.x
  • ArrayLong.truncate - declared in lib/typed-array.x
  • ArrayLong.truth - declared in lib/typed-array.x
  • ArrayShort.capacity - declared in lib/typed-array.x
  • ArrayShort.clear - declared in lib/typed-array.x
  • ArrayShort.free - declared in lib/typed-array.x
  • ArrayShort.len - declared in lib/typed-array.x
  • ArrayShort.pop - declared in lib/typed-array.x
  • ArrayShort.truncate - declared in lib/typed-array.x
  • ArrayShort.truth - declared in lib/typed-array.x
  • ArrayString.capacity - declared in lib/typed-array.x
  • ArrayString.clear - declared in lib/typed-array.x
  • ArrayString.free - declared in lib/typed-array.x
  • ArrayString.len - declared in lib/typed-array.x
  • ArrayString.pop - declared in lib/typed-array.x
  • ArrayString.truncate - declared in lib/typed-array.x
  • ArrayString.truth - declared in lib/typed-array.x
  • Array.capacity - declared in lib/array.x
  • Array.clear - declared in lib/array.x
  • Array.free - declared in lib/array.x
  • Array.len - declared in lib/array.x
  • Array.pop - declared in lib/array.x
  • Array.truncate - declared in lib/array.x
  • Array.truth - declared in lib/array.x
  • Bytes.capacity - declared in lib/block.x
  • Bytes.clear - declared in lib/block.x
  • Bytes.free - declared in lib/block.x
  • Bytes.len - declared in lib/block.x
  • Bytes.pop - declared in lib/block.x
  • Bytes.truncate - declared in lib/block.x
  • Bytes.truth - declared in lib/block.x
  • File.clearerr - declared in lib/file.x
  • File.close - declared in lib/file.x
  • File.eof - declared in lib/file.x
  • File.error - declared in lib/file.x
  • File.fileno - declared in lib/file.x
  • File.flush - declared in lib/file.x
  • File.getc - declared in lib/file.x
  • File.getpos - declared in lib/file.x
  • File.pclose - declared in lib/file.x
  • File.purge - declared in lib/file.x
  • File.rewind - declared in lib/file.x
  • File.seek - declared in lib/file.x
  • File.seeko - declared in lib/file.x
  • File.setbuf - declared in lib/file.x
  • File.setpos - declared in lib/file.x
  • File.setvbuf - declared in lib/file.x
  • File.tell - declared in lib/file.x
  • File.tello - declared in lib/file.x
  • File.va_printf - declared in lib/file.x
  • File.va_scanf - declared in lib/file.x
  • String.c_compare - declared in lib/string.x
  • String.c_find - declared in lib/string.x
  • String.c_len - declared in lib/string.x