develooper Front page | perl.perl6.language | Postings from September 2001

Re: Custom iterators

Thread Previous | Thread Next
From:
Piers Cawley
Date:
September 25, 2001 00:41
Subject:
Re: Custom iterators
Message ID:
m3zo7j90th.fsf@iest.bofh.org.uk
Michael G Schwern <schwern@pobox.com> 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


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About