3 ms·
Rust has 'Conditions', which basically allow the current function to run a closure when an error happens which tells it what to do on the error, and then contin
by DSMan195276 12y ago
Rust has 'Conditions', which basically allow the current function to run a closure when an error happens which tells it what to do on the error, and then continue the function call. I don't know much Rust or Common Lisp though, so I'm not sure if they're the same thing. Rust's condition functionality definitely doesn't unwind the stack when calling back though, because in Rust unwinding the stack isn't ever allowed because of memory safety issues.
- steveklabnik 12y agoRust's conditions were actually removed. [1] They don't need language support, though, so you could re-add them as a library. When they existed, they were very close to Common Lisp conditions. 1: https://github.com/mozilla/rust/pull/12039 https://github.com/mozilla/rust/pull/12039