so... jai :D

This commit is contained in:
agra
2026-02-04 01:34:30 +02:00
commit 55fc5790e4
60 changed files with 15876 additions and 0 deletions

20
examples/04-shadow.sx Normal file
View File

@@ -0,0 +1,20 @@
#import "modules/std.sx";
main :: () -> s32 {
x := 42;
{
print("scope opened\n");
defer print("scope closed\n");
// define a inner variable x shadowing the one define in the outer scope(s)
x:= 6;
print("scoped x: {}\n", x); //expect 6
}
print("main x: {}\n", x); //expect 42
}
// ** stdout **
// scope opened
// scoped x: 6
// scope closed
// main x: 42
//