4 ms·
Your statement is true for throwing exceptions, however you cannot catch exceptions in pure way
by zygimantasdev 7y ago
Your statement is true for throwing exceptions, however you cannot catch exceptions in pure way
- iainmerrick 7y agoWhy not? Edit: to make sure we’re on the same page, I interpret “pure” as no side-effects and no non-determinism, so a call with the same arguments always has exactly the same result. What side-effect does “catch” have? Something that’s visible externally, visible to the caller of the function doing the catch. I suppose if you catch an exception and pull out the stack trace, that gives you some extra information about the caller. Even that doesn’t make you impure, though, if you treat the call stack as additional input.