Re:(On | No) Syntactic Support for Error Handling
by dcow on Tuesday June 03, 2025 @07:39PM
(#44175913)
Where there’s a will there’s a way. Swift is almost universally
compatible with objective-c and they are two entirely different languages no less. If an objective-c function has a trailing *error parameter, you can, in swift, call that function using try notation and catch and handle errors idiomatically. All it takes is for one pattern to be consistently expressible by another. Why can’t Result/Either types be api-compatible with functions that return tuples?
[ Parent
| on HN ]
Re:(On | No) Syntactic Support for Error Handling
by joaohaas on Wednesday June 04, 2025 @09:46AM
(#44180705)
As I mentioned, it's the same method Rust uses, and there are multiple reasons on the papers linked on why that is not desired.
Re:(On | No) Syntactic Support for Error Handling
by dcow on Wednesday June 04, 2025 @05:26PM
(#44185719)
I didn't say desired. It would work. Do it and if nobody uses it then so be it. Don’t balk and say “well we could but the elite minds in charge have high quibbles with how it would affect the feel of the language in this one absurd edge case, so we won’t”. Just special case the stupid pattern.