-
Notifications
You must be signed in to change notification settings - Fork 0
Enumerated values
Leon Starr edited this page Nov 6, 2023
·
2 revisions
Since enumerated values are generally limited in number and are often used to test cases, it makes sense to express them in actions. So these literals are allowed in Scrall.
A type might be defined such as Valve State with values { open, closed }
And then a variable position of that type would be used like so to decide which event to send:
position?
_open : Close -> target valve
_closed : Open -> target valve
Enumerated values are always prefaced with a _ symbol in Scrall. In circumstances where the data type cannot be inferred from context, the data type must precede the value like this: Valve State::_closed.
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