Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Defer will be executed normally when the function exits. yield here is not a statement but a normal function.


I.e. C# and many other languages transform a function with the yield statement into a state machine implementing the iteration protocol.

This proposal does the opposite. It transforms the loop body into a closure passed into the iterator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: