Skip to content

Creating a table with a definition

Leon Starr edited this page Sep 5, 2021 · 2 revisions

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.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally