On Tue, Dec 10, 2002 at 01:02:18PM -0800, Brent Dax wrote:
> Peter Haworth:
> # @b = @a.grep { /\S/ }, $c;
> #
> # how does the compiler know whether $c is an argument to grep,
> # or another element to be assigned to @b?
>
> The same way it does when it sees a normal sub?
>
> I know, late binding and all that. But when you think about it, a lot
> can be done to simulate the conditions otherwise. For example, with a
> definition like this:
>
> class Foo {
> method bar($self: $baz) { ... }
> }
>
> And a call like this:
>
> @b=$foo_obj.bar $baz, $quux;
>
> Where we can see *at runtime* that $quux is too many arguments, we can
> just append it to the end of bar()'s return value. (This would only
> happen when there were no parentheses.)
Seems to me that you just gave a really good argument for requiring
the parentheses.
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]