lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Apr 05, 2006, at 12:27, Lisa Parratt wrote:

D Burgess wrote:
ungetc() does not help.

ARGH! NO! THE HORRORS!

That gave me nightmares for weeks, that did. ungetc is a disgusting abomination that shouldn't even exist, let alone be used.

It's often useful in lexing. The functionality of ungetc will always be needed, and I think that's unavoidable. So if it didn't exist then lots of programs would end up implementing their own version of Standard C IO streams, but with one byte of pushback.

I'm curious as to why you don't like it so much. Is it buggy vendor implementations? Non-portable C code that relied on more than one byte of ungetc? Having to implement a C-like stream interface on top of an abstraction that didn't provide anything like ungetc? Or something else?

drj