Initial Commit
This commit is contained in:
789 files changed
+149185
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import std::io;
|
||||
struct serial : attribute { val name: span<u8>; val aliases: span<u8>[2]; }
|
||||
struct weight : attribute { val value: i64 = 1; }
|
||||
const def double(x: i64): i64 { return x * 2; }
|
||||
@serial{ name = "point", aliases = ["p", "pt"] }
|
||||
struct point { @weight{ value = double(21) } var x: i64; @weight var y: i64; }
|
||||
enum axis { @weight x, y }
|
||||
@weight def sum(p: point): i64 { return p.x + p.y; }
|
||||
def main(): void {
|
||||
println($"{sum(point{ 3, 4 })} {axis::y as i64}");
|
||||
}
|
||||
Reference in new issue
Block a user