so... jai :D
This commit is contained in:
20
examples/05-run.sx
Normal file
20
examples/05-run.sx
Normal file
@@ -0,0 +1,20 @@
|
||||
#import "modules/std.sx";
|
||||
// this will bake x to be 7 as a global constant
|
||||
x :: #run compute(5);
|
||||
|
||||
compute :: (v: s32) -> s32 => v + 2;
|
||||
|
||||
main :: () {
|
||||
//test
|
||||
y :: #run compute(7);
|
||||
c :: 2;
|
||||
print("hello {}\n", x + y * c);
|
||||
}
|
||||
|
||||
#run main();
|
||||
|
||||
// ** stdout after build **
|
||||
// hello 25
|
||||
|
||||
// ** stdout after run **
|
||||
// hello 25
|
||||
Reference in New Issue
Block a user