-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a table with a definition
Alternatively, you can create a table with a set of attribute-type pairs:
t4 #= #[ x: xloc, y: yloc ] // Table with one row
t5 #= #[ x:Rational, y:Rational ] // Table with zero rows
In this example t4 is assigned a table with two columns and one row. The variables xloc and yloc implicitly type the header elements. Table variable t5 is assigned a table with two attributes each of type Rational. Since no values are supplied, the type designates must be explicit.
To create a table with multiple rows, use the ; symbol to separate the rows:
t6 #= #[ x: xloc1, y:yloc1; x: xloc2, y: yloc2 ]
To initialize the relational true and false equivalents (see C.J. Date’s writings on tabledum and tabledee) do this:
tabledum #= false // zero attributes, zero rows
tabledum2 #= #[] // same result as above
tabledee #= true // zero attributes, one row
tabledee2 #= #[1] // same result as previous
Two methods are provided to keep the syntax consistent. To keep your actions consistent and readable, choose the one method that suits you and stick to it.
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