{"path":"/sutl/guide/larger-transformations","content":{"title":"7. Larger transformations","summary":"Reshape documents, transform real data and construct programs as values.","body":"[sUTL](/sutl) · [Guide](/sutl/guide) · [Reference](/sutl/reference) · [Examples](/sutl/examples)\n\nThe Studio examples show three useful scales of sUTL programming.\n\n## Reshaping a document\n\nPaths embedded in a structural map are the simplest useful pattern:\n\n```json\n{\n  \"person\": {\n    \"fullname\": \"^$.name\",\n    \"title\": \"Mr\"\n  },\n  \"address\": {\n    \"line1\": \"^$.addr\"\n  }\n}\n```\n\nThis is analogous to a JSON template, but every value can be an arbitrary\ntransform.\n\nSee the\n[path-basic-2 example](/sutl/examples/path-basic-2).\n\n## Transforming real data\n\nThe tweet example selects a screen name and text, recursively gathers\nseveral URL fields, and removes nulls through a library transform. It includes\nits original 2010 Twitter object as source data:\n\n[tweettransform](/sutl/examples/tweettransform)\n\n## Constructing transforms\n\nThe sum and average examples demonstrate sUTL's Lisp-like side: a transform can\nconstruct another transform, inspect it, and evaluate it. Start with:\n\n[fixedsum](/sutl/examples/fixedsum)\n\nThen compare the explicit scope form:\n\n[avgrefactor1](/sutl/examples/avgrefactor1)\n\n## Working with the Studio catalogue\n\nThe [catalogue](/sutl/examples) contains:\n\n- 44 complete Studio bundles with source, transform, declaration, and library\n- expected results checked by the Python 3 and browser runners\n- archive timestamps and original iframe IDs\n- 12 curated guide examples\n- 19 explicit gaps where no archived Studio input has been found\n\nThe expected result makes each example executable and testable. Normative\nlanguage behavior remains in the conformance corpus.\n\n## Where to go next\n\nUse sUTL where code-as-data, immutable transformations, and portable JSON-shaped\nprograms are an advantage. For new work, keep transforms small, test them\nagainst explicit source/result examples, use `!!` for higher-order scope, and\ncompile named dependencies rather than relying on ambient libraries.\n\nNext: [Historical dialects and implementations](/sutl/guide/history).\n\n## Continue learning\n\n[Previous: 6. Declarations and libraries](/sutl/guide/declarations-and-libraries) · [Guide contents](/sutl/guide) · [Language reference](/sutl/reference)\n\n## Source\n\nAdapted from [the sUTL source material](https://github.com/emlynoregan/sutllang-site/blob/e59ecafd364848cd71a1d18ce74cdf67f2f69328/content/guide/07-larger-transformations.md).\n\n[Back to sUTL](/sutl) · [Software & Agents](/topics/software-and-agents) · [All topics](/guide)","author":"Emlyn O'Regan"}}