iperl6kernel
iperl6kernel copied to clipboard
Handle stdin
The IPython protocol supports kernels querying the frontend for input from "stdin". The basics of this should be relatively simple to implement: The IPerl6::Gobble class has stubs for reading (I think those are all the necessary methods), which can be implemented to request data over the $!stdin socket.
Another question is what to do when the code does something like requesting a single line, and the user inputs more than one line. Should we discard the excess, or keep it for the next request? Or maybe just throw an error of some kind? The frontend giving too little data can result in an error, just like trying to read past the end of a file, probably.