Kronos
Language

Data Types

Learn about the data types available in Kronos

Data Types

Kronos supports several built-in data types.

Numbers

Numbers can be integers or floating-point values.

set integer to 42
set decimal to 3.14159
set negative to -10
set large to 1000000

Strings

Strings are sequences of characters enclosed in double quotes. See the Strings documentation for detailed string operations.

set greeting to "Hello, World!"
set empty to ""
set multiline to "Line 1\nLine 2"
set formatted to f"Hello, {name}!"  # F-string interpolation

Booleans

Boolean values are true and false.

set is_active to true
set is_complete to false

Null

The null value represents the absence of a value.

set value to null

Lists

Lists are ordered collections of values. See the Lists documentation for details.

set numbers to list 1, 2, 3, 4, 5
set mixed to list "hello", 42, true, null

Maps

Maps are key-value collections. See the Maps documentation for details.

set person to map name: "Alice", age: 30, city: "NYC"
set scores to map 1: 100, 2: 200, 3: 300

Type Annotations

You can use type annotations to enforce types:

let age to 25 as number
let name to "Bob" as string
let active to true as boolean

Attempting to assign a different type will result in an error:

let age to 25 as number
let age to "twenty"  # Error: Type mismatch

On this page