Update outdated comments

This commit is contained in:
lording 2023-06-22 12:11:24 +00:00
parent 3e502fe69b
commit d52f360731
3 changed files with 7 additions and 7 deletions

View file

@ -6,10 +6,10 @@
// const Stuff = enum(u8){ foo = 16 };
//
// You can get the integer out with a builtin function,
// @enumToInt(). We'll learn about builtins properly in a later
// @intFromEnum(). We'll learn about builtins properly in a later
// exercise.
//
// const my_stuff: u8 = @enumToInt(Stuff.foo);
// const my_stuff: u8 = @intFromEnum(Stuff.foo);
//
// Note how that built-in function starts with "@" just like the
// @import() function we've been using.

View file

@ -4,7 +4,7 @@
// Ziglings exercise.
//
// We've also seen @intCast() in "016_for2.zig", "058_quiz7.zig";
// and @enumToInt() in "036_enums2.zig".
// and @intFromEnum() in "036_enums2.zig".
//
// Builtins are special because they are intrinsic to the Zig
// language itself (as opposed to being provided in the standard

View file

@ -6,8 +6,8 @@
//
// ...and lots of type casting operations such as...
//
// @as @intToError @intToFloat
// @intToPtr @ptrToInt @enumToInt
// @as @errorFromInt @floatFromInt
// @ptrFromInt @intFromPtr @intFromEnum
//
// Spending part of a rainy day skimming through the complete
// list of builtins in the official Zig documentation wouldn't be