HNHacker News
TopNewBestAskShowJobs

vaughan0

5 karma · joined August 15, 2012

submissionscomments
vaughan0··on A Field Guide to Lua Coroutines
> "The main limitation of Lua coroutines is that, since they are implemented with setjmp(3) and longjmp(3), you cannot use them to call from Lua into C code that calls back into Lua that calls back into C, because the nested longjmp will clobber the C function’s stack frames. (This is detected at runtime, rather than failing silently.)"

Lua 5.2 provides a mechanism to help with this: http://www.lua.org/manual/5.2/manual.html#4.7

vaughan0··on Write More Classes
Personally I find myself avoiding writing in a functional style in Python because of it's lack of good anonymous function literals and poor handling of closures in nested functions.

Edit: when I say "poor handling of closures in nested functions" I'm referring to having to use nonlocal in order to modify variables in the parent function's scope.