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

> All the transpiler has to do is invent a globally unique name for each function, for instance.

I would expect nested functions to close over their context. Still implementable in C of course (or ghc -fvia-c wouldn't work), but not as trivially.



Procedures can appear at the top level in a module as well as inside other scopes, in which case they are called nested procs. A nested proc can access local variables from its enclosing scope and if it does so it becomes a closure.

From the manual: http://nim-lang.org/manual.html#closures




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

Search: