let idx = 1 let numbers: @int set numbers[idx] = 32 set numbers[1] = numbers[0] let numbers_arr: int[0xff] set numbers_arr[0] = numbers[0] let ptr_arr: @int[0xff] set ptr_arr[0] = @numbers[0] struct hallo { a: int b: str } let b: @hallo set b[0].a = 1 struct ptrs { a: @int b: str[128] c: hallo[100] } let c: ptrs set c.a[0] = 1 set c.b[0] = "ho" ; set c.c[0].a = 1 ; this doesn't work at the moment fun foo(a: int): int { 1 } fun bar(): int { fun foo(): int 1 + 2 1 } let a = 1 match a { case 1 = "ha" case 2 = "ho" } cond { 1 == 1 = "ha" 2 != 2 = "ho" } struct vec { x: f64 y: f64 huh: { z: int id: str } } let v: vec = vec : { x = 10.0 huh = { z = 10 id = "blah" } } fun baz(): nil { struct vec { z: f64 } let a: vec set a.z = 1.0 } struct ext { x: f64 = 2.0 y: f64 = 1.0 bruh: { id: int = 10 msg: str = "hello" inner: { x: int = 32 y: str } } } let v2: ext set v2.x = 1.0 set v2.bruh.id = 1 set v2.bruh.inner.y = "yo" set v2 = ext : { x = 1.0 y = 32.0 bruh = { id = 1 } } struct person { name: str = "joe" age: int = 18 * 2 } ; We can use the dot operator to access fields. let player_a: person set player_a.name = "alex" struct vecf { x: f64 y: f64 z: f64 } let v3 = vecf : { x = 1.0 } enum weekdays { mon = 1 tue wed thu fri sat sun } let d = weekdays.tue match 1 { case 2 = "monday" case 3 = "tuesday" else = "whateverday" } match d { case mon = "monday" case tue = "tuesday" else = "whateverday" } fun add10(a: int, b: str): int { a + 10 } fun add(): int { add10(1, "hello") } let f:f64 = (1.0 + 2.0 * 2.0) / 2.0 let annotated:int = (1 + 2 * 2) / 2 let arith = 1 + 2 * 4 let cmp = 1 <= 2 let logic = !true && false || (1 <= 2) let bits = 0xff & 0b00001111 let block = { let a = 1 + 2 a + 3 } let maybe = if (1 == 2) { 32 } else { 44 } let single = if (true) { 123 } while (!true) { println("asjdflasdjf") } set single = 32 cond { 1 == 2 = "hello" else = "dong" } fun nested(): int { fun adder(a: u32, b: u32): u32 { a + b } if (1 + 1 == 2) { let b = 15 { let c = 32 5 + c } } }