7. Larger transformations
Reshape documents, transform real data and construct programs as values.
sUTL · Guide · Reference · Examples
The Studio examples show three useful scales of sUTL programming.
Reshaping a document
Paths embedded in a structural map are the simplest useful pattern:
{
"person": {
"fullname": "^$.name",
"title": "Mr"
},
"address": {
"line1": "^$.addr"
}
}
This is analogous to a JSON template, but every value can be an arbitrary transform.
See the path-basic-2 example.
Transforming real data
The tweet example selects a screen name and text, recursively gathers several URL fields, and removes nulls through a library transform. It includes its original 2010 Twitter object as source data:
Constructing transforms
The sum and average examples demonstrate sUTL's Lisp-like side: a transform can construct another transform, inspect it, and evaluate it. Start with:
Then compare the explicit scope form:
Working with the Studio catalogue
The catalogue contains:
- 44 complete Studio bundles with source, transform, declaration, and library
- expected results checked by the Python 3 and browser runners
- archive timestamps and original iframe IDs
- 12 curated guide examples
- 19 explicit gaps where no archived Studio input has been found
The expected result makes each example executable and testable. Normative language behavior remains in the conformance corpus.
Where to go next
Use sUTL where code-as-data, immutable transformations, and portable JSON-shaped
programs are an advantage. For new work, keep transforms small, test them
against explicit source/result examples, use !! for higher-order scope, and
compile named dependencies rather than relying on ambient libraries.
Next: Historical dialects and implementations.
Continue learning
Previous: 6. Declarations and libraries · Guide contents · Language reference
Source
Adapted from the sUTL source material.