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

Not having every block be a separate value makes it easier for the Ruby VM to optimize such code without escape analysis (which is something that's pretty hard to do in this language).

Don't have to allocate the container => don't need to use the heap one more time. Nor access the block's code through that indirection.

Same thing with methods: they aren't objects, but you can create an object pointing to a method any time you need one.



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

Search: