News for hackers. Stuff that matters.
Re:Go: What We Got Right, What We Got Wrong by campbel on Friday January 05, 2024 @01:58PM (#38883107)
Couldn't we do an optional type with the type system as is rather than embedding in the language?

type Optional[V any] struct { IsSet bool Value V }

Re:Go: What We Got Right, What We Got Wrong by kaba0 on Friday January 05, 2024 @04:09PM (#38884979)
The type system would store it at compile time, while your type would only have it at runtime.
Re:Go: What We Got Right, What We Got Wrong by ncruces on Friday January 05, 2024 @04:48PM (#38885426)
How does that prevent an unset Value from being used?