On Fri, Dec 03, 2004 at 06:38:42PM -0800, Larry Wall wrote: : Might even just be a global multi sub that defaults to $*ARGS: : : multi sub *lines (IO ?$handle = $*ARGS) {...} : multi sub *lines (Str $filename) {...} : multi sub *lines (IO @handle) {...} : multi sub *lines (Str @filenames) {...} : : Then the filter call would be quite hypoallergenic: : : for lines {...}
Except that won't parse right, drat it. It won't know whether to expect a term or an operator at the left bracket. Can't use a 0-or-1-ary as the last thing in the list. That was the advantage of .lines, which we could tell had no arguments, since methods with arguments must use parens. Don't wanna go back to bare "*" either; I've since made it a synonym for Any. Plus it also suffers the 0-or-1 problem. It would still work as a unary, if we can figure out something really short to mean $*ARGS. [Much bogus random brainstorming deleted.] Well, I just need to think about it some more. I've already believed six impossible things after dinner, so maybe I'd better go to bed. Larry