3 ms·
Nothing I've seen in any other language comes close to CLs condition system. It makes exceptions look like stone age technology. Technically I'm sure you could
by mtlmtlmtlmtl 3y ago
Nothing I've seen in any other language comes close to CLs condition system. It makes exceptions look like stone age technology.
Technically I'm sure you could do everything conditions do even in C with like setjmp/longjmp, but... good luck with that.
- zozbot234 3y agoYou can implement resumable conditions using coroutine support. They're very comparable features.
- mtlmtlmtlmtl 3y agoTrue. It's so nice to just have them in the language though. Because then the whole library ecosystem is using the same abstraction, making it far more useful.
- steveklabnik 3y agoFun fact: long ago, Rust had conditions!
- mtlmtlmtlmtl 3y agoInteresting. Why were they removed?
- steveklabnik 3y agoSee https://github.com/rust-lang/rust/issues/9795 https://github.com/rust-lang/rust/issues/9795 and the linked PR that removed them.
- brabel 3y ago> let tps = if_ok!(self.tps(as_.tps, bs.tps)); Ha, that's how the question mark operator (and the previous encarnation, the `try!` macro) was born then :)
- steveklabnik 3y agoYup! https://github.com/rust-lang/rust/issues/12037 https://github.com/rust-lang/rust/issues/12037