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

Yes, you can do it that way. But then you'll need a "context pointer" to pass references to the locals it'll need, and the function will need to be located "someplace else", meaning it is not encapsulated.

I've done that for years with C and C++. Nested functions are so much nicer and clearer.



Got it now, thanks. I've used nested functions in Python and they have some good uses. Will check them out in D.




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

Search: