2 ms·
Wow, I hate this. But it’s … oddly almost kinda elegant? In a very hard to mentally model way, but even so. Speaking more seriously than is perhaps warranted,
by zbentley 2y ago
Wow, I hate this. But it’s … oddly almost kinda elegant? In a very hard to mentally model way, but even so.
Speaking more seriously than is perhaps warranted, I’d slightly prefer it if there were syntactically different “catch” constructs for resumable and nonresumable exceptions, which would remove syntactic ambiguity around whether “return” was sending control flow back to the thrower of the nearest immediate exception or not.
Also, the stdlib shouldn’t have chickened out with regular value-returning functions. Just because the dogfood gives you heartburn doesn’t mean you shouldn’t eat it :)
- zzo38computer 2y ago> Also, the stdlib shouldn’t have chickened out with regular value-returning functions. Just because the dogfood gives you heartburn doesn’t mean you shouldn’t eat it :) Yes, although an alternative would be to make the syntax if you call the function where a value is expected, then it will automatically catch.
- zzo38computer 2y agoAnother alternative would be to use macros instead.