const, if as a value, """ text over several lines, min/max/abs/clamp, import a/b and import x as y, the fs module

- const NAME = value (numbers, text, other constants; typed: const f32 G = 9.8), also module.NAME
- x := if c { a } else { b }
- """ ... """: the closing quotes' indentation goes from every line
- min, max, abs, clamp for any numbers, unless your own function has the name
- import ui/button (a module in a folder), import path as p
- fs: read_bytes, write_bytes, exists, is_dir, mkdir (with parents), list, remove_dir, data_dir(app)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016GzNP6r8dg6WDxUVZy8wjL
This commit is contained in:
Nexoniarz 2026-10-29 09:37:41 +01:00
commit f2d6480749
21 changed files with 688 additions and 17 deletions

View file

@ -0,0 +1,5 @@
// expect: is a constant; it can't be changed
const W = 3
fn main() {
W = 4
}

View file

@ -0,0 +1,6 @@
// expect: a constant is made of numbers, text
fn f() -> int { return 1 }
const W = f()
fn main() {
print(W)
}

View file

@ -0,0 +1,6 @@
// expect: is worked out from itself
const A = B + 1
const B = A
fn main() {
print(A)
}

View file

@ -0,0 +1,4 @@
// expect: an if that gives a value needs an else
fn main() {
x := if true { 1 }
}

View file

@ -0,0 +1,4 @@
// expect: both branches of the if have to give the same type
fn main() {
x := if true { 1 } else { "one" }
}

View file

@ -0,0 +1,5 @@
// expect: is already used by another import
import path
import time as path
fn main() {
}

View file

@ -0,0 +1,6 @@
// expect: is indented less than the closing
fn main() {
s := """
a
"""
}