KScript docs
EN

What changed

Text, names and values

Before Now
Section(title: Results) Section(title: "Results"): text in an argument goes in quotes, and a bare word is a name fix (KS6009)
Button(on_click: "count += 1") Button(on_click: $count += 1), or on_click: { $count += 1 }: double quotes always make text
'Hello $name' "Hello { $name }": double quotes evaluate expressions in braces. Single quotes keep text as written
$route = "/users/{id}", "\d{3}", "a { color: red }" '/users/{id}', '\d{3}', 'a { color: red }', or doubled braces ("/users/{{id}}"): a { } in double quotes always holds an expression, whatever it opens with, so "{ User->count() } users" and "{ 1 + 2 }" fill in
total = 3, total += 1, const tax = 0.2 $total = 3, $total += 1, const $tax = 0.2: a variable has its $ where it is set, too fix (KS6010)
fn($n) => $n * 2 fn(n) => $n * 2 fix (KS6010)
numbered: no, new_page: yes numbered: false, new_page: true (or the flag on its own: new_page) fix (KS6011)
spawn(fn: job), tools: lookup spawn(fn: @job), tools: [@lookup]: a function is named as @name fix (KS6012)
files: "settings, .env" files: ['settings', '.env']: a list is an array fix (KS6006)
timeout: 30, ttl: '10m' timeout: 30s, ttl: 10m: a length of time has its unit and no quotes fix (KS6018)

Edit this page on GitHub