|
|
@ -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.
|
|
|
|