The basic unit in the Planarly programming language is the table. A table is a 2 dimensional rectangular grid of values. The smallest table is a 1x1 table - a single cell.
A table is an abstract data structure. Don't confuse it with the grid of cells in a spreadsheet. In Planarly that is called a Region, which will be covered shortly.
Values in a table can be one of the following types:
Blank
: a special value held by empty cells.True
and False
1234
.4.0
"a string"
evaluates to a 8 character string.Tables can contain any combination of types.
The dimensions of a table are always written as (height, width) which is (rows, columns).
Almost everything in Planarly is a table. E.g. 1
is a table of dimension 1x1 and its only cell contains the value 1
.
The operator &
concatenates two tables side by side and the operator \\\\
stacks one table on top of another. &
has a higher precedence than \\\\
. This allows you to construct inline tables :
1 & 2 \\\\ 3 & 4
evaluates to:$$ \begin{array}{c|c} 1 & 2 \\ \hline 3 & 4 \end{array} $$
"background" & ("yellow" & "gray")
evaluates to:$$ \begin{array}{c|c|c} background & yellow & gray\\
\end{array} $$
"background & ( "yellow" \\\\ "gray" )
evaluates to: