Syntax
Synsema reads like prose. Blocks are defined by indentation (4 spaces or 1 tab) — there are no curly braces.
-- Doc example: core syntax. Universal code; English comments.
intent: "doc example: variables, operators, pipe, inline conditional"
task double(n)
give n * 2
print("5 |> double = " + text(5 |> double)) -- run shows: 5 |> double = 10
test "let / set / arithmetic"
let x be 10
set x to x + 5
assert_eq(x, 15)
assert_eq(10 % 3, 1)
test "comparison + boolean logic"
assert(1 < 2 and 2 <= 2)
assert(true or false)
assert(not false)
test "pipe is unary application: x |> f == f(x)"
assert_eq(5 |> double, 10)
test "inline conditional is an expression"
let label be when 80 >= 50 then "pass" otherwise "fail"
assert_eq(label, "pass")
Variables
let name be value introduces a binding; set name to value reassigns it.
Operators
- Arithmetic:
+-/%. Division is always float* (10 / 3→3.333…). - Comparison:
==!=<><=>=. - Logic:
andornot. - Pipe
|>is unary application:x |> fmeansf(x)(wherefis a task name or a one-argument lambda). For multiple args, wrap it:xs |> ((v) => f(v, extra)).
Inline conditional
when cond then a otherwise b is an expression (usable inside let, a map, or a call), distinct from the when block statement.
Strings
"..."/'...'— single-line, with escapes (\n,\t,\"). A literal newline inside is an error.- `
...— multiline + interpolation:Hello {name}evaluates{expr}`. Ideal for SQL/HTML.
Comments
-- a comment runs to end of line.