From d52f360731fcfaf47818addfd61332bf0c0e39a5 Mon Sep 17 00:00:00 2001 From: lording Date: Thu, 22 Jun 2023 12:11:24 +0000 Subject: [PATCH] Update outdated comments --- exercises/036_enums2.zig | 4 ++-- exercises/064_builtins.zig | 2 +- exercises/065_builtins2.zig | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/036_enums2.zig b/exercises/036_enums2.zig index 3348f86..dc2998c 100644 --- a/exercises/036_enums2.zig +++ b/exercises/036_enums2.zig @@ -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. diff --git a/exercises/064_builtins.zig b/exercises/064_builtins.zig index f9c156a..1d680d8 100644 --- a/exercises/064_builtins.zig +++ b/exercises/064_builtins.zig @@ -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 diff --git a/exercises/065_builtins2.zig b/exercises/065_builtins2.zig index 7d3e770..7d9939a 100644 --- a/exercises/065_builtins2.zig +++ b/exercises/065_builtins2.zig @@ -1,13 +1,13 @@ // // Zig has builtins for mathematical operations such as... // -// @sqrt @sin @cos -// @exp @log @floor +// @sqrt @sin @cos +// @exp @log @floor // // ...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