On Fri, 2002-05-03 at 12:37, Larry Wall wrote:
> Piers Cawley writes:
> : Consider the following.
> :
> : sub foo {...}
> :
> : foo *@ary;
> : foo * @ary;
> :
> : Is this another place where whitespace will have meaning? Or should I
> : add parentheses to disambiguate? Enquiring minds want to know.
>
> I see no ambiguity. It's a unary * in either case. You'd have to
> declare it
>
> sub foo () {...}
>
> to get a multiply out of it.
Ok, I'm not going to say you're wrong (I most likely am), but I would
like to try to understand why this would be true.
The tokenizer is going to hand back what? 'bareword:foo', '*', 'type:@',
'identifier:ary'?
In which case, it seems to me that you would be right, but there's a big
trap.... Does that mean that if foo has the following:
sub foo();
sub foo($x,$y);
Then you always get multiply, or you always get argument expansion? Is
that going to be counter-intuitive for the programmer who uses a library
that provides such a definition?