Cory Spencer <[EMAIL PROTECTED]> wrote:
> 'peek' implements an opcode which can look ahead at an arbitrary number of
> bytes in a IO stream, but does not remove the bytes from the stream in the
> process.

> The proposed format is:

>   peek(out STR, in INT)

> where $1 contains up to $2 peek'ed bytes from STDIN, and

>   peek(out STR, in PMC, in INT)

Looks quite good and usefule. IO maintainers please peek at that patch.

I have some question though:

- what if peek wants to look beyond current buffered limits
- what are the guarantees of peek's result (AFAIK 1 byte for the stream
  layer if ungetc() is available) - what else?
- don't other layers need adjustment if a new layer function is
  added?
- did you miss appending all the tests ;)

leo

Reply via email to