From: Yusuke ENDOH Date: 2010-04-28T23:23:13+09:00 Subject: [ruby-core:29851] Re: [Bug #2449] StringIO#ungetc behavior is contrary to its spec Hi, 2010/4/28 NAKAMURA, Hiroshi : > On Wed, Apr 28, 2010 at 21:34, Yusuke Endoh wrote: >>> Do you mean this IO change (multiple pushbacks and behind the >>> beginning) should be backported to 1.8? >> >> I move this ticket to 1.8. >> But it may be difficult for 1.8 that uses C's stdio to implement IO. > > Yes. So I think that the following is not correct. > > | ?There is no > | ?limitation for multiple pushbacks including pushing back behind the > | ?beginning of the buffer string. The above spec is valid just for StringIO#ungetc. It is not directly connected to IO#ungetc. Do you mean StringIO#ungetc should behave the same as IO#ungetc, even in such corner case? My honest opinion is, this behavior should be considered implementation- defined, not a spec, not only in 1.8 but also in 1.9. User should not depend on such a "corner case" behavior :-) -- Yusuke Endoh