Skip to content

References

Benedict Albrecht edited this page May 20, 2026 · 4 revisions

References

References substitute reusable object patterns into other definitions. The referenced object's variables are merged into the parent — without creating a child relationship.


How References Work

graph LR
    FUNC["<b>function</b><br/>&lt;-{string, int}-&gt;"] -.->|"merges variables"| STR["<b>string</b><br/>&lt;&lt;var&gt;&gt;"]
    FUNC -.->|"merges variables"| INT["<b>int</b><br/>&lt;&lt;var&gt;&gt;"]

    style FUNC fill:#4a90d9,color:#fff
    style STR fill:#e67e22,color:#fff
    style INT fill:#e67e22,color:#fff
Loading

Key: Referenced objects do not appear as children. Only their variables are merged.


Syntax

<-{ refA, refB ... }->

References cannot be empty.


Example

Define reusable parameter types:

<:string:> string <<var>> <:>
<:int:> int <<var>> <:>

Use them as references in a function definition:

<:function:> function <<name>> ( <-{string, int}-> ) { <---> } <:>

The function can accept string or int parameters. The <<var>> variable from each referenced object is added to the function's variable set.


vs. Sub-bodies

Feature Reference <-{}-> Sub-body <--->
Creates children
Merges variables
Appears in tree

Next: Or Statements — Matching one of several alternatives.

Clone this wiki locally