sUTL
Guide · 06 / 07

6. Declarations and libraries

evaluate operates on transforms. A declaration gives a transform a name, dependencies, language tag, and optional acceptance test:

{
  "name": "addone_example_org",
  "language": "sUTL",
  "transform-t": ["&+", "^@.value", 1],
  "requires": []
}

A distribution is an ordered list of declarations.

Requiring a transform

Requirements use prefix matching. Requiring "addone" can select "addone_example_org". compilelib stores the selected transform under the required name, so callers use:

{
  "!": "^*.addone",
  "value": 4
}

* selects the compiled library; the result is 5.

Interactive conformance example: JavaScript is required to edit and run it.

Transitive requirements

If a selected declaration has requirements of its own, compilelib resolves those recursively. The working runner reports a missing requirement as a compile failure instead of creating an incomplete library.

Interactive conformance example: JavaScript is required to edit and run it.

Acceptance tests

A declaration’s optional test-t is evaluated with transform-t as its source. Falsey means success; truthy conventionally contains failure messages. This allowed consumers to accept a compatible declaration without relying on a central version number.

Interactive conformance example: JavaScript is required to edit and run it.

Naming

Historical names progress from specific to general and commonly end in a domain namespace:

map_core_emlynoregan_com

A consumer may require map, map_core, or the full name. Shorter prefixes allow substitution but can also match unintended candidates, so applications should choose requirements deliberately.

Library overrides

The language intended library transforms named _override_<builtin> to replace host builtins. The Python 2 implementation contains a string-formatting defect in this path. The sUTL runner implements the intended spelling, but new guide examples do not depend on overrides.

Next: Larger transformations.