On Wed, Mar 26, 2008 at 12:03 PM, Larry Wall <[EMAIL PROTECTED]> wrote:
> On Wed, Mar 26, 2008 at 11:00:09AM -0700, Jon Lang wrote:
> : all unary operators, be they prefix or postfix, should be evaluated
>  : before any binary operator is.
>  And leaving the pool of voting mathematicians out of it for the moment,
>  how would you parse these:
>     sleep $then - $now
>     not $a eq $b
>     say $a ~ $b
>     abs $x**3

Those don't strike me as being unary operators; they strike me as
being function calls that have left out the parentheses.  Probably
because they're alphanumeric rather than symbolic in form.

>  These all work only because unaries can be looser than binaries.
>  And Perl 5 programmers will all expect them to work, in addition to
>  -$a**2 returning a negative value.

True enough.  Perhaps I should have said "as a rule of thumb..."

>  And we have to deal with unary
>  precedence anyway, or !%seen{$key}++ doesn't work right...
>  Larry

Jonathan "Dataweaver" Lang

Reply via email to