Re: Customizable default hash and array values.

2001-09-25 Thread Dan Sugalski
At 10:06 PM 9/24/2001 -0400, Michael G Schwern wrote: >Wouldn't it be nice if there was a way to change the default value of >a hash? So instead of undef you'll get whatever default you like? Sure, I don't see why not. The hash access function is responsible for returning a value, so there's no

Re: Custom iterators

2001-09-25 Thread Michael G Schwern
On Tue, Sep 25, 2001 at 12:59:51PM -0400, Uri Guttman wrote: > > "MGS" == Michael G Schwern <[EMAIL PROTECTED]> writes: > > MGS> Backwards? > > MGS> File.read_backwards($filename) { > MGS> print > MGS> } > > not trivial but not too hard. check out File::ReadBackwards

RE: Custom iterators

2001-09-25 Thread Brent Dax
Uri Guttman: # $fh.irs( 'Peterbilt' ) ; We're going to have an IRS property on filehandles? God, I can hear the jokes already... --Brent Dax [EMAIL PROTECTED] Configure pumpking for Perl 6 They *will* pay for what they've done.

Re: Custom iterators

2001-09-25 Thread Uri Guttman
> "MGS" == Michael G Schwern <[EMAIL PROTECTED]> writes: MGS> Backwards? MGS> File.read_backwards($filename) { MGS> print MGS> } not trivial but not too hard. check out File::ReadBackwards for a way to do it efficiently in perl5. it requires some careful seeking, buf

Re: Custom iterators

2001-09-25 Thread Michael G Schwern
On Tue, Sep 25, 2001 at 08:39:06AM +0100, Piers Cawley wrote: > 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 n

Re: Custom iterators

2001-09-25 Thread Piers Cawley
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 constr