RE: Custom iterators

2001-10-04 Thread Richard_Cox
Bart Lateur [mailto:[EMAIL PROTECTED]] on 3 October 2001 12:05 wrote: > But I really really doubt if there's any computer language in > the world C (C99 anyway[1]), C++[2], SQL99[3] to name but three [1] _Pragma, _Complex,... [2] bit_and, wchar_t, ... [3] CURRENT_TIMESTAMP Richard Cox Senior S

Re: Custom iterators

2001-10-03 Thread Michael G Schwern
On Wed, Oct 03, 2001 at 01:05:26PM +0200, Bart Lateur wrote: > But I really really doubt if there's any computer language in the world > that uses underscores in their keywords. OH! Then I *did* explain it badly! These >>>are not keywords!<<< They're no

Re: Custom iterators

2001-10-03 Thread Bart Lateur
On Tue, 2 Oct 2001 21:30:19 -0400, Michael G Schwern wrote: >On Wed, Oct 03, 2001 at 02:26:47AM +0200, Bart Lateur wrote: >> >foreach_line { print } 'some/file'; >> >> You really like underscores, do you? > >If all you got out of that thread was "Schwern likes underscores" then I >explained

Re: Custom iterators

2001-10-02 Thread Michael G Schwern
On Wed, Oct 03, 2001 at 02:26:47AM +0200, Bart Lateur wrote: > >foreach_line { print } 'some/file'; > > You really like underscores, do you? If all you got out of that thread was "Schwern likes underscores" then I explained iterators really, really, really badly. -- Michael G. Schwern

Re: Custom iterators

2001-10-02 Thread Bart Lateur
On Tue, 25 Sep 2001 12:42:43 -0400, Michael G Schwern wrote: >Or how about character by character? > >File.each_byte($filename) { >print >} > >Backwards? > >File.read_backwards($filename) { >print >} [in an earlier post:] >foreach_line { print } 'some/file';

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

Re: Custom iterators

2001-09-24 Thread Michael G Schwern
On Mon, Sep 24, 2001 at 10:38:44PM -0400, Bryan C. Warnock wrote: > On Monday 24 September 2001 09:58 pm, Michael G Schwern wrote: > > yield() [2] simply says "run the block associated with this method > > once". Similar to the $block->() call, but since it's not a full > > subroutine call, just

Re: Custom iterators

2001-09-24 Thread Bryan C . Warnock
On Monday 24 September 2001 09:58 pm, Michael G Schwern wrote: > yield() [2] simply says "run the block associated with this method > once". Similar to the $block->() call, but since it's not a full > subroutine call, just a block enter/exit (like a normal iteration > through a loop) there's two