-
Notifications
You must be signed in to change notification settings - Fork 0
Signatures and name doubling
In all activity types, parameter names are specified using formal : actual pairing and never with implicit ordering. Consider an event specification defined as follows:
Set new dest( Destination : Name, Direction : Vertical Direction ) // Not Scrall!
Two parameters, Destination and Direction, with data types Name and Vdir are required in the Set new dest event specification. To generate a corresponding event, supply values of the appropriate types paired up with the parameter names in any order.
Set new dest( Direction : ^dir; Destination : ^dest floor ) -> ME
Note how the parameter names and supplied variable names closely match? As a convenience, and to avoid name doubling clutter, you can drop the formal parameter if the name of the actual parameter matches the formal parameter name. Let’s change the event specification to this:
Set new dest( Dest floor : Name; Dir : Vertical Direction ) // Not Scrall!
Now the formal parameter names match the actual parameter names the action can be shortened like this:
Set new dest( ^dir, ^Dest floor ) -> ME // less clutter
The action language is also easier to read and less trouble to write. If the actual parameter and formal names don’t match, a static error results.
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