3 ms·
In java / C#, this is how their exception works. Indeed it is bad in performance, but you can define exception as flow. For example: try{ } catch(S
by fendy3002 6y ago
In java / C#, this is how their exception works. Indeed it is bad in performance, but you can define exception as flow. For example:
try{
}
catch(SQLException ex) { }
catch(MathException ex) { }
So it is kinda correct thay you reinvented the exception handling in java / c#, without really raising error / exception itself.
- breck 6y agoThanks that's a clear example. What I'm looking for is a name for a pattern where a function returns (typeof ExpectedType | typeof InvalidType). Say it's a pipelined compiler and you want all the passes to continue even with InvalidTypes, and then at the end of the pipeline the result is a structure of the correct shape, but there may be some "holes" filled with InvalidTypes. So one way to say it is exception types without the Try/Catch.