On Fri, Dec 03, 2004 at 09:31:33AM -0800, Larry Wall wrote: : I guess the only real argument against unifying is that neither of : : for [EMAIL PROTECTED] {...} : : or : : for @foo {...} : : indicate destructive readout. Which probably says that * : is the wrong operator to use for that, which undoes our pretty : : for * {...}
This is all muddled thinking anyway, since [EMAIL PROTECTED] would read the arguments, not the lines from the files contained in the arguments. Despite the history of ARGV in Perl 5, I wonder if it's a mistake to overload @ARGS and $ARGS to mean two different things. On the other hand, it'd be nice if we could end up with something readable like: for .lines {...} where the implicit invocant of Main knows how to iterate magically through the lines of @ARGS. I suppose that implicit invocant could be named $ARGS. The magic still consists of making a bunch of filenames look like a single filehandle. A method like .lines could work either on a filehandle, or on a string representing a filename, or an array of filehandles, or an array of strings representing filenames. We also potentially get things like for .slurp {...} for .paragraphs {...} But we have to be careful with things like for "foo".bytes {...} since "foo".bytes returns 3, not the bytes of file "foo". So there needs to be some intermediate method to say that you mean io. Taking a page fro IO::All, I suppose we could have "foo".io.bytes or some such. But $ARGS would already be an io object, so people presumably wouldn't have to always say for .io.lines {...} As I've said before, I like the idea of IO:All, except for the overloading of < and >. Perhaps we could go with <== and ==> instead. Larry