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

The interresting part is that you can define on the spot a single usen, throwaway function to be used as a parameter of a function that accepts functions as arguments.

Another property of lambdas is nested defines with the possibility to return an inner function (be it anonymous or not) from an outer one.

At last their lexical scope allows, in the inner/outer functions described above, to keep the scope of the outer function alive as long as the returned inner function is referenced. This allows to make them work as lightweight objects (or even to define an object system if you want to).



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

Search: