2 ms·
Loop forever, or, more commonly in actual use cases, terminate via a nonlocal return (eg. exceptions, `longjmp`, `abort`). As an aside, in any programming lang
by Sharlin 6y ago
Loop forever, or, more commonly in actual use cases, terminate via a nonlocal return (eg. exceptions, `longjmp`, `abort`).
As an aside, in any programming language that does not support/enforce total functions, the return type `T` of any function is actually the sum type `T | Bottom`, which is to say, "this function either returns a value of type `T` or never returns to its caller at all!"
Also used as the type of expressions that do not return a value (things like `break`, `continue`, or `throw` in expression-oriented languages).
- aliceryhl 6y agoI mean, `T | Bottom` is the same type as `T`, so what you're saying is vacuously true.