4 ms·
Also nice: a throw in Swift is like a return! It is setting the exception in a specific register and then returns. The ‘throws’ signature indicates to the calle
by rahkiin 2y ago
Also nice: a throw in Swift is like a return! It is setting the exception in a specific register and then returns.
The ‘throws’ signature indicates to the caller two things: the user needs to use some exception handling, and the callsite needs to handle the special return register in case it is filled with an exception
This way you do not need to do expensive stack walking