-
Notifications
You must be signed in to change notification settings - Fork 0
Rename
It is common practice to name a referential attribute and its reference target differently. To join two such class tables together we need to rename one of the attributes so that the names match up. We use the rename >> operator for this purpose.
For example, let’s say we have an Arrival class with attributes Aircraft and Airport representing all scheduled arrivals. Now we want to find all Aircraft not scheduled to arrive anywhere. We could do this:
non_arriving_ids #= Aircraft.Tail number - Arrival[Aircraft >> Tail number]
The complete table access format including rename is <table>fromName >> toName, ….(<projection>). You can omit any or all braced or parenthesized components if there is nothing to specify. The dot, however, is required when any projection is specified.
We use the >> rename operator on Arrival.Aircraft to yield a table whose header matches the projection on Aircraft.Tail number. Then we subtract the set of Arrival tail numbers from the set of all Aircraft tail numbers to yield all Tail numbers not scheduled to arrive.
Here’s one such example:

To create a table of ATC ID’s matched with station locations, we could do this:
atc locations #= (Duty Station ## On Duty Controller[Number >> Station].(ID, Location)
The common attribute in the join has a different name in each class. Either Station should be renamed as Number or vice versa. In the example above the Number attribute is renamed. Then, we project over ID and Location.
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration