x-lang

← Index

x/doc/registry

Doc: the documentation registry as data – one record per documented name.

The registry as data: (Doc entry ‘name) answers a record with name, desc, returns, params, examples, sees, notes and samples; (Doc names) lists every documented name.

Class Doc

A documentation entry as data: what one (doc …) form filed, a field per part. (Doc entry ‘name) answers one; (Doc names) lists every documented name. The params are (name TYPE desc) triples, the examples and samples (expr . result) pairs of strings, the sees symbols and the notes strings, as the doc form wrote them.

name

Field: data carried by a Doc instance.

desc

Field: data carried by a Doc instance.

returns

Field: data carried by a Doc instance.

params

Field: data carried by a Doc instance.

examples

Field: data carried by a Doc instance.

sees

Field: data carried by a Doc instance.

notes

Field: data carried by a Doc instance.

samples

Field: data carried by a Doc instance.

(Doc entry name)

The entry documented under name, as a Doc record, or () when nothing is documented under it. A name is a bare symbol as the registry keys it, a method as Class/method, a module as its name; a string is interned first.

Parameters:

Returns: ANY — A Doc record, or ()

Examples:

((Doc entry "Str8/split") name) => 'Str8/split
(first ((Doc entry 'Str8/split) returns)) => 'LIST
(null? (Doc entry 'no-such-name-zz)) => #t

(Doc names)

Every documented name, sorted, each once: the names apropos searches and Tab completes. The list is built once and answered again until another name is documented, so it is shared: read it, do not change it.

Returns: LIST — Symbols, sorted by name

Examples:

(List includes? 'Str8/split (Doc names)) => #t