comptime format
This commit is contained in:
@@ -1212,5 +1212,16 @@ END;
|
||||
print("sprite-scale: {}\n", s.scale);
|
||||
}
|
||||
|
||||
// --- Comptime format ---
|
||||
{
|
||||
ct_body :: "hello";
|
||||
ct_msg :: format("say: {} (len={})", ct_body, ct_body.len);
|
||||
print("{}\n", ct_msg);
|
||||
|
||||
ct_num :: 42;
|
||||
ct_num_msg :: format("n={}", ct_num);
|
||||
print("{}\n", ct_num_msg);
|
||||
}
|
||||
|
||||
print("=== DONE ===\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user