lua-users home
lua-l archive

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


David Jones wrote:
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.

Meh - few excuses that still hold in this day and age for not buffering in memory before processing, imho.

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?

All of the above. It also adds a special case when coding implementations - makes the code fugly imho.

--
Lisa