Nick Ing-Simmons [mailto:[EMAIL PROTECTED]] exclaims:
> Paul Green <[EMAIL PROTECTED]> writes:
> >> How do you guarantee you'll never hit the code in 
> >> PerlIOStdio_unread that does ungetc inside a loop?
> >
> >We will hit it. But it will fail after the first ungetc.
> >
> >We have hidden variables in the stream data structure that tell
> >us whether an ungetc is permitted. The ungetc function sets and
> >checks these hidden variables such that any attempt to do two
> >ungetc's in a row will cause subsequent ungetc's to return an
> >error.
> 
> Which seems overly picky if you not at beginning of the buffer,
> why not allow ptr to back up and take as much as you are given?

My only defense is that the guy who wrote the code was a picky sort of
fellow (not me, by the way). We implement what the standard requires us to
implement, and no more. I'm rather loathe to change it now. The people in
charge of this area would almost certainly stand on the language of the
standard and stick with what we have. I can see both sides of this argument
have valid points, and I'm ducking!  ;-)

PG

Reply via email to