Just realized I can write macros which export values into the caller's scope based on potentially-compile-time-generated code :niggapoggers:
the following compiles and prints the right value:
ExpandInsertTest :: () #expand {
#insert "`quasimorph :: 15;";
}
main :: () {
ExpandInsertTest();
print("quasimorph = %\n", quasimorph);
}
the following compiles and prints the right value:
ExpandInsertTest :: () #expand {
#insert "`quasimorph :: 15;";
}
main :: () {
ExpandInsertTest();
print("quasimorph = %\n", quasimorph);
}
1