3 ms·
I wrote an article about the closure aspect of Ruby blocks that was intended for beginners: http://darwinweb.net/articles/41-ruby_blocks_as_closures http://dar
by dasil003 17y ago
I wrote an article about the closure aspect of Ruby blocks that was intended for beginners:
http://darwinweb.net/articles/41-ruby_blocks_as_closures http://darwinweb.net/articles/41-ruby_blocks_as_closures
It really focuses on just one aspect of closures that Ruby's syntax makes especially convenient, which is that they enable you to write generic functions that don't need to know a single detail about what kind of data they are being applied to.