Data Types
Tenet is dynamically typed. Values have types; variables do not.
Numbers
All numbers are 64-bit floating point (IEEE 754 double precision).
var x = 42; // Integer
var pi = 3.14159; // Decimal
var neg = -17.5; // Negative
Note: Scientific notation (e.g.,
1.5e10) is not yet supported.
Strings
Strings are enclosed in double quotes. Single quotes are not supported.
var greeting = "Hello, World!";
var empty = "";
var multiword = "Game Theory DSL";
String Concatenation
Use + to join strings:
var full = "Hello, " + "World!";
print full; // Hello, World!
Booleans
Two boolean literals: true and false.
var yes = true;
var no = false;
Truthiness
When used in conditionals:
falseandnilare falsy- Everything else is truthy (including
0and"")
if (0) {
print "zero is truthy"; // This runs!
}
Nil
The absence of a value.
var nothing = nil;
var uninitialized; // Also nil
Type Summary
| Type | Examples | Description |
|---|---|---|
| Number | 42, 3.14, -5 | 64-bit floating point |
| String | "hello", "" | Text in double quotes |
| Boolean | true, false | Logical values |
| Nil | nil | Absence of value |
Next Steps
- Variables & Scope → — How to use variables