2 ms·
"not an expert in zig" but you can't even look at the documentation to find the `@tagName` builtin to do exactly the problem posed?: https://ziglang.org/documen
by peesem 6d ago
"not an expert in zig" but you can't even look at the documentation to find the `@tagName` builtin to do exactly the problem posed?: https://ziglang.org/documentation/0.16.0/#tagName https://ziglang.org/documentation/0.16.0/#tagName
i can literally google "zig enum to string" and the first result is a reddit post where the given solution is `@tagName`. i'm ready to write this post off as a low-effort ad for C3
- jb1991 6d agoAgree, the post was extremely low effort.
- ManuLinares 6d ago[dead]
- hiccuphippo 6d agoIf it's for debugging purposes, you can use `{any}` as the format and it will print `.BLUE` std.debug.print("{any}\n", .{color});
- lerno 6d agoC3 has an even simpler way than Zig: `Color.RED.description`. From what I can see the example started from C++, and then comparing how each language would look building it in userland instead.