3 ms·
> It sure does work :-) That you've marked the function `throws E` is an admission it doesn't really work; that's the one exception type it definitely doesn't
by morelisp 5y ago
> It sure does work :-)
That you've marked the function `throws E` is an admission it doesn't really work; that's the one exception type it definitely doesn't throw. (Default handling is also still different than the starting point.)
Please just stop trying to show off how much you know when I'm trying to discuss how programs in general are actually implemented. You're very clever, but part of why you keep getting it slightly wrong is because probably you don't even write error handling like this day to day.
- azth 5y ago> That you've marked the function `throws E` is an admission it doesn't really work Correct, I didn't spend a lot of time refining it. I suppose the only way to make it work is to remove `throws E` from the signature and make it `throw new RuntimeException(e)`, and be similar to C#/Kotlin/Scala. My last JVM job used Scala, and we wrote things that are similar to val x = foo() match { case Success(res) => res case Error(e) => return quux() // Returns from function scope }