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

> Blocks are actually instances of the Proc class.

No, they aren't.

Blocks can be reified into instances of the Proc class, but they are not objects and reifying them into objects has overhead.

Using a & argument asks for a block passed to the method to be reified into a proc accessible in the body of the method, which is useful if you are going to do something with it that you can't do with a bare block.



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

Search: