On 1/31/07, Allison Randal <[EMAIL PROTECTED]> wrote:
Answering some questions from PDD 22.
thanks! all your edits are sane.
- On naming, let's go with a simple 'IO'. It's in the parrot namespace, so ['parrot';'IO']. IO is the base class, and may have other children such as ['parrot'; 'IO'; 'Socket'] (perhaps a role). - That said, I'll keep the text using more generic phrasing, rather than always "an C<IO> object", because not all stream objects will necessarily be instantiations of the C<IO> class. (Though, it does need some work on consistency between "I/O object", "I/O stream", and "stream object". I'll come back and do a pass on that.)
sounds great.
- On "C<new> is usually performed by the C<open> opcode", you asked "how does .open usually perform .new? .open requires a ParrotIO object". The 'open' method does require an IO object. The 'open' opcode doesn't. It creates and returns an I/O object. - The asynchronous version of the .close method was already described.
sorry, i was a bit distracted when i was reviewing those parts--luckily those comments were easy to ignore :)
- On a .say method: pass. It's mainly a convenience for humans, but to do it as a method they'd have to first create or get an I/O object, and then call the method, so not very convenient.
fine.
- 'chomp' is a string operation, not a filehandle operation. I can see adding a chomp method to the String PMC.
you're right, it belongs in String. while writing tests for readline and print, i found it annoying to 1) have to explicitly print the record separator between lines, and 2) explicitly remove it when reading lines. but that does belong on the String object.
- I wasn't sure what you meant by the 'use a config probe' comment, so I left it in for now.
that is an implementation note: .get_fd() only works on unix filehandles. we'll need to probe to see if the stream is a unix filehandles. i noted it would probably be a config probe, but now i'm not so sure how it'll be determined. ~jerry