lording 2 лет назад
Родитель
Сommit
d52f360731
3 измененных файлов с 7 добавлено и 7 удалено
  1. 2 2
      exercises/036_enums2.zig
  2. 1 1
      exercises/064_builtins.zig
  3. 4 4
      exercises/065_builtins2.zig

+ 2 - 2
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.

+ 1 - 1
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

+ 4 - 4
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