0x0LearnReferenceLibrariesMigration0x0.jmp0x1b.com

Functions, Bindings, And Annotations

Current implementation evidence: examples/pure-capability.0x0,

docs/language.html, and docs/documentation.html.

Function Shape

Functions use ƒ:


(ƒ add
  (∷ (→ I64 I64 I64))
  (cap pure)
  (doc "Return the sum of two integers without effects.")
  (a b)
  (+ a b))

The parameter list appears after annotations. The function body follows the

parameter list.

Type Annotations

carries the current checked source contract:


(∷ (→ I64 I64 I64))

The current checker validates the implemented slice:

This is not a complete type system. Complex unresolved cases remain permissive.

Documentation Annotations

doc annotations describe public functions:


(doc "Return the sum of two integers without effects.")

The compiler parses and skips doc annotations for output behavior. The API

documentation generator reads them for public docs.

Bindings

Use for local names:


(≔ ((sum (+ 20 22)))
  sum)

The compiler validates that local symbols resolve to parameters or earlier

bindings.

Practical Habit

Write public functions with type, capability, and doc annotations when the

function belongs to a library or framework. Keep local helpers documented when

their representation choices are not obvious.