Update outdated comments

pull/2/head
lording 1 year ago
parent 3e502fe69b
commit d52f360731

@ -6,10 +6,10 @@
// const Stuff = enum(u8){ foo = 16 }; // const Stuff = enum(u8){ foo = 16 };
// //
// You can get the integer out with a builtin function, // 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. // 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 // Note how that built-in function starts with "@" just like the
// @import() function we've been using. // @import() function we've been using.

@ -4,7 +4,7 @@
// Ziglings exercise. // Ziglings exercise.
// //
// We've also seen @intCast() in "016_for2.zig", "058_quiz7.zig"; // 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 // Builtins are special because they are intrinsic to the Zig
// language itself (as opposed to being provided in the standard // language itself (as opposed to being provided in the standard

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

Loading…
Cancel
Save