Improved 02 comment about imports being const

This commit is contained in:
Dave Gauer 2021-02-10 09:27:43 -05:00 committed by GitHub
parent 961cf22b88
commit 6a7153eafb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,8 @@ pub fn main() void {
std.debug.print("Standard Library.\n", .{}); std.debug.print("Standard Library.\n", .{});
} }
// Going deeper: imports must be declared as "constants" (with the 'const' // For the curious: Imports must be declared as constants because they
// keyword rather than "variables" (with the 'var' keyword) is that they // can only be used at compile time rather than run time. Zig evaluates
// can only be used at "compile time" rather than "run time". Zig evaluates // constant values at compile time. Don't worry, we'll cover imports
// const values at compile time. Don't worry if none of this makes sense // in detail later.
// yet! See also this answer: https://stackoverflow.com/a/62567550/695615 // See also this answer: https://stackoverflow.com/a/62567550/695615