This will help fix the issues with IO.ungetc
REFACTORING: supporting a list of bytes, which will help fix issues w…
Nice... ungetc has been dragging on for too long. Will review and merge.
Changes look good, and I'll merge them in. We may want to do our own lighter-weight implementation of the ungot characters buffer, so ungetting a byte doesn't end up creating both a Byte and a LinkedList node.
@headius What I could do is change the code to be lazy, and only creating the linked list when trying to ungetc more than one byte. How that sounds?
@josedonizetti That's a good start, since most IO users won't ever ungetc. However I was thinking of something more like a byte-based ArrayList where we could simply unget an additional byte by setting a byte element and moving an offset.
Heh, as I wrote this it suddenly occurred to me: we have ByteList. So what if we just use a ByteList and ungetc appends a byte into it and removes bytes from it, rather than using LinkedList? I don't think the code would change much.