I was wondering if there (ever) will be - or is talked about - a kind of “my own dedicated descendant of a native zig type”, where we can implement functions for. Without having to wrap it inside a struct (which is of course always possible).
You can have named values, that you can exhaustively switch on, i.e. the compiler will yell at you if you don’t handle nothing or unlimited. And you can differentiate between an else and _ branches. You can’t do that with the equivalent wrapper struct.
I understand. But that’s a different sort of need than just wanting to define a new type that’s equivalent to a primitive type and attach methods. For that I think a struct wrapper is the simplest and most convenient.
My only concern about this usage is that it duplicates functionally with the packed struct and violates the principle of “There is only one solution”. I hope to get more opinions on the best practices here regarding when to use custom numbers constructed with such pure non-exhaustive enumerations and when to use packed struct that wraps only one field.