3 comments

  • peesem1 hour ago
    &quot;not an expert in zig&quot; but you can&#x27;t even look at the documentation to find the `@tagName` builtin to do exactly the problem posed?: <a href="https:&#x2F;&#x2F;ziglang.org&#x2F;documentation&#x2F;0.16.0&#x2F;#tagName" rel="nofollow">https:&#x2F;&#x2F;ziglang.org&#x2F;documentation&#x2F;0.16.0&#x2F;#tagName</a><p>i can literally google &quot;zig enum to string&quot; and the first result is a reddit post where the given solution is `@tagName`. i&#x27;m ready to write this post off as a low-effort ad for C3
    • hiccuphippo11 minutes ago
      If it&#x27;s for debugging purposes, you can use `{any}` as the format and it will print `.BLUE`<p><pre><code> std.debug.print(&quot;{any}\n&quot;, .{color});</code></pre>
    • jb199154 minutes ago
      Agree, the post was extremely low effort.
    • ManuLinares44 minutes ago
      [dead]
  • RyanVail42 minutes ago
    Zig doesn&#x27;t have attributes, but you could just create a thin wrapper struct over an inner type and use setter functions that throw errors on invalid values. Personally I prefer this over attributes because it forces you to handle possible error states from the callers of the setters, instead of relying on you remembering to call `validate` on your types.
  • WalterBright1 hour ago
    There&#x27;s a large black zig-zag blocking reading the text.