-
Notifications
You must be signed in to change notification settings - Fork 0
Converting a table into a class
Leon Starr edited this page Sep 5, 2021
·
1 revision
You cannot convert a table directly into a class since there are usually referential attributes involved and it would be quite easy to violate referential integrity by populating a table with invalid references.
But you can convert a table into a set of instance references and then assign those to an instance set variable like so:
tlow #= Aircraft(Altitude < floor)
tids #= tlow.(Tail number)
low flying aircraft::Aircraft ..= tids
We need to specify a table whose header is a superset of at least one of the target class’s identifiers. In this case it just means that the table tids must have Tail number in its header.
Note that we need the :: type definition symbol to ensure that the instance set variable is defined on the correct class.
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