Re: [perl #21656] [PATCH] read buffering in i/o

2003-03-22 Thread Benjamin Goldberg
"JüRgen BöMmels" wrote: [snip] > is(, <, < char buf[1024]; [snip] > len = PIO_read(interpreter, io, buf, sizeof(buf)); [snip] > buf[len] = '\0'; This, almost certainly, should be: buf[MIN(len, 1023)] = '\0'; After all, 'len' could concievably be 1024, if you decide to change you

[perl #21656] [PATCH] read buffering in i/o

2003-03-22 Thread Jürgen
# New Ticket Created by Jürgen Bömmels # Please include the string: [perl #21656] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt2/Ticket/Display.html?id=21656 > Hello, Yet another step in PIO: Enabling read buffering. The first read will fill th

Re: is static? -- Question

2003-03-22 Thread arcadi shehter
Matthijs van Duin writes: > > >does it mean that this is legitimate > > > > sub a { > > state $x; > > my $y; > > state sub b { state $z ; return $x++ + $y++ + $z++ ; } > > return &b; # is a \ before &b needed? > > } > > No, since you can't refer to $y in that s

Re: is static? -- Question

2003-03-22 Thread Matthijs van Duin
On Sat, Mar 22, 2003 at 10:24:09PM +0200, arcadi shehter wrote: sub a { state $x; my $y; my sub b { state $z ; return $x++ + $y++ + $z++ ; } return &b; # is a \ before &b needed? } will all &b refer to the same $z ? yes, they will does it mean that this is legitimate su

Re: is static? -- Question

2003-03-22 Thread arcadi shehter
Matthijs van Duin writes: > > A nice example is: > > sub a { > state $x; > my $y; > my sub b { return $x++ + $y++; } > return &b; # is a \ before &b needed? > } > > Every call to sub a will return a different closure. The $x in > each closure all refer to the same

Re: is static? -- Question

2003-03-22 Thread Matthijs van Duin
On Sat, Mar 22, 2003 at 09:45:43PM +0200, arcadi shehter wrote: in this example sub a { state $x ; my $y ; my sub b { ... } ; ... } how "my sub b" is different from "state $x" from the point of view of scope ? Actually, all three have the same scope, but they have different lifet

Re: is static? -- Question

2003-03-22 Thread arcadi shehter
Larry Wall writes: > > I think it's also a mistake to give C two unrelated meanings. > These are not lexically-scoped variables any more than "our" > variables are, and the fact that they can happen accidentally in > Perl 5 as persistent lexically scoped variables is, er, accidental. > They

[PATCH] Iterator proof of concept

2003-03-22 Thread Leopold Toetsch
After the overwhelming amount of f'ups to my proposal: Subject: [RfC] Yet another iterator proposal. Date: Mon, 10 Mar 2003 16:17:35 +0100 I (as well as our tireless summarizer) thought, the concept ought to be ok. But a test says more then 1000 RfCs so here is a first step towards implementatio