Message from discussion Perl6 HyperOperator List
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-langu...@perl.org
Date: Wed, 30 Oct 2002 09:25:21 -0800 (PST)
To: Austin Hastings <austin_hasti...@yahoo.com>
cc: Brent Dax <brent...@cpan.org>, "'Buddha Buck'" <bmb...@14850.com>, "'Michael Lazzaro'" <mlazz...@cognitivity.com>, <perl6-langu...@perl.org>
Subject: RE: [RFC] Perl6 HyperOperator List
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
From: la...@wall.org (Larry Wall)
On Wed, 30 Oct 2002, Austin Hastings wrote:
: --- Brent Dax <brent...@cpan.org> wrote:
: > Buddha Buck:
: > # How would you parse:
: > #
: > # @a = @b[];
: > A 2D array slice, since you can't hyper numbers?
: It's hypering the .
I don't think so. We can't allow general expressions inside a hyper 
where it could be confused with a subscript, if for no other reason than
that people will read it first as a subscript.
In fact,  for hyper works for postfix and prefix operators only if we
can specifically distinguish the inside operator from an expression.
An earlier message had something like this as a hyper:
@a = @b[.method];
That absolutely won't work, because [.method] is a valid subscript.
In this case it would have to be written
@a = @b[.]method;
But the general problem is just about enough to kill the whole 
idea for hyper. It's really only rescuable if we have a known set of
operators to match against. Then on the basis of the rule of matching
the longest token possible, we can have the hyper interpretation
override any interpretation as a subscript or anonymous array composer.
For example, [undef] is a vector undef only if C<undef> is a member of
that distinguished set of operators.
I think making people remember a distinguished set of operators is a
bad thing, particularly when we've gone to such great lengths to
fuzz the boundary between unary ops, argument method calls, and list
ops that just happen to have one argument at the moment.
So despite the beauty of
@a [+] @b
I think it cannot survive in its current form. It overloads square
brackets too heavily.