3 ms·
That's actually a great counter example! Tho most day-to-day high level PL don't have a type system capable of offering this sort of checks!
by AYBABTME 10y ago
That's actually a great counter example! Tho most day-to-day high level PL don't have a type system capable of offering this sort of checks!
- vertex-four 10y agoHonestly... you could do it as a primitive type if you wanted. The only "special" bits needed are a piece of syntax which checks if it's an error, and if so returns it, else evaluates to the private value; and a way of unwrapping the actual error value when you want to handle it. Go already has plenty of complicated language primitives with complex behaviour.