3 ms·
Swift, but it is bound to narrower scopes, not just the function scope like Go. How does Nim scope defer statements?
by Jtsummers 3y ago
Swift, but it is bound to narrower scopes, not just the function scope like Go. How does Nim scope defer statements?
- archargelod 3y agoIn Nim, defer is a macro, that rewrites scope into "try: finally:" statement. 'finally' code block is always executed, even if there were any exceptions. https://nim-lang.org/docs/manual.html#exception-handling-defer-statement https://nim-lang.org/docs/manual.html#exception-handling-def...
- Jtsummers 3y agoYeah, my main question was about the scope of the defer but it appears that it's block scoped like Swift, not function scoped like Go.