ocaml / oloop

Evaluate code through the OCaml toploop for inclusion in educational material.
ISC License
12 stars 5 forks source link

make output type more accurate #1

Closed agarwal closed 9 years ago

agarwal commented 9 years ago

We currently define type phrase, but the definition isn't really accurate. It assumes a separation of stderr and stdout, but actually these outputs should be interleaved. Also exceptions aren't mentioned. The correct type to represent outputs is probably something like:

type output = [`Stdout of string | `Stderr of string] list * exn option

This captures all stdout and stderr in the order that output occurs. It also includes an exception that may have been raised.

The harder part is to:

Chris00 commented 9 years ago

There is still the goal of capturing stdout and stderr in the right order while distinguishing them but I do not think it is easy to do—short of modifying the underlying C library but I do not think we want to do that.

agarwal commented 9 years ago

Closing this issue. It is essentially done, short of the last point mentioned by @Chris00 which is not a requirement at this time.