Understanding Values
Strings, Numbers, Tables, and more
Ultimately the point of any program is to produce a value. The Technique language has serveral value types:
Unit
The unit type is written a : () -> ()\n and its
sole value Unitus is written {()}.
String literals
Literal text string in Technique are called Literali and are written as
you'd expect, enclosed with double-quotes:
{"Late, as in the Late Arthur Dent"}.
Newlines can be included in strings, escaped with
{"\n"}.
Numbers
Numbers are either integrals which is to say signed integers, {42}, or quantities, which are
measurements with (optional) magnitude, uncertainty, and units. {5.9722 ± 0.0006 × 10²⁴ kg} was the
mass of the planet earth, until about five minutes ago. Both kinds of number
are recorded as Quanticle values.
Key/Value Tables
Ultimately you need to label and group the values you create, and a tablet is the way to do this. A tablet returned by a procedure or function is a Tabularum value in Technique. Literal values can be written
{
[
"answer" = 42
"question" = ?
]
}
where {["answer"=1]} and
{["question"=1]} are the fields and each is
assigned a value.
We also see the hole character {?},
indicating a Futurae, a value to be supplied later, at runtime. Normally you
dont need this, but sometimes you have to be explicit in your code about
values you don't know yet and have to wait a few million years for.
There are times when you need to supply a list, for example to {foreach x in y} when iterating or as
arguments provided to a procedure whose signature requires a list. In those
situations you can write a tablet without labels and with values separated by
commas {[ 1, 4, 9 ]}, thus
creating an Arraeum.