Michael G Schwern <[EMAIL PROTECTED]> writes:
[ A description of the Ruby 'block' syntax ]

Note too that, adopting the block syntax would let you do:

    File.new($filename) { ... }

Which doesn't look like much, but new could be implemented in such a
way that, if called with a block, the constructor would simply iterate
over the file and then explicitly close the file. Given the GC issues
of immediate finalization being hard to do (albeit possible), using
constructs that don't need it would surely be a Good Thing.

-- 
Piers Cawley
www.iterative-software.com

Reply via email to