logoalt Hacker News

stousetyesterday at 4:27 AM2 repliesview on HN

Out of curiosity why can’t a block just do this natively?


Replies

masklinnyesterday at 7:53 AM

Because it would massively alter langage semantics? It converts returns from the nearest function into returns from the nearest (try) block.

lunar_mycroftyesterday at 7:49 AM

Because then you couldn't use ? to propagate errors if they occurred inside any loops or branches within the function, which would be a significant limitation.