On Sat, Aug 11, 2012 at 4:29 PM, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote: > For files, finish() should close the file (or at least flush it - unclear on > that). I also wonder whether there exists a better name than finish(), and > how to handle cases in which e.g. you finish() an output range and then you > put more stuff into it, or you finish() a range several times, etc. >
As another data point, std.log has a Logger interface which defines log(...) and flush (...) so this fits perfectly into this output range design. Here are the current signatures: shared void log(const ref LogMessage message); shared void flush(); finish would be a weird name for 'interface Logger' because it is not a final operation. For what it is worth, Java's OutputStream has the following: void write(...) // overloaded three times void flush() // "Flushes this output stream and forces any buffered output bytes to be written out." void close() // "Closes this output stream and releases any system resources associated with this stream."