Hacker News new | ask | show | jobs
by valenterry 499 days ago
Can you elaborate more?
1 comments

There it says "errors are values" so now that contradicts what OP said.
I said I wasn't speaking for Zig specifically, just on general principle that errors are not really values. Many languages reify errors as values to avoid having different semantics for errors, but errors probably should have their own semantics. Zig seems to take a middle ground here, where errors are a special type of value but that still sort of has its own semantics.
> I said I wasn't speaking for Zig specifically

Lol, you are right. My brain just skipped that part somehow.

I was generally responding to the whole thread and pointing to how Zig sees errors. Enums are a type of value, yes, but they're typically dealt with differently than other data types.