Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: not(1) && 0 is true! #822

Closed
p5pRT opened this issue Nov 6, 1999 · 2 comments
Closed

Re: not(1) && 0 is true! #822

p5pRT opened this issue Nov 6, 1999 · 2 comments

Comments

@p5pRT
Copy link
Collaborator

@p5pRT p5pRT commented Nov 6, 1999

Migrated from rt.perl.org#1750 (status was 'resolved')

Searchable as RT1750$

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Nov 6, 1999

From ilya@math.ohio-state.edu

I very much doubt this description. You are missing "if it looks like
a function call, it is a function call" rule (see C<print (1)>
clause). lc has a very low precedence "on the right" as well.

But somehow C<not> got through the cracks of this rule. This is most
probably a bug (so I CC perlbug).

it may be ugly but how would you get this to work​:

not ($foo && $bar ) || ($aaa && $bbb)

not can't grab the first parens according to boolean algebra.

Boolean algebra has no relationship to parens. You are trying to
pretend that Perl is parsed basing on precedences. It is not.

Ilya

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Nov 8, 1999

From @TimToady

-------------- Forwarded message -----------------
Return-Path​: <larry@​kiev.wall.org>
Received​: (qmail 1213 invoked from network); 9 Nov 1999 00​:40​:30 -0000
Received​: from kiev.wall.org (205.178.11.135)
  by tmtowtdi.perl.org with SMTP; 9 Nov 1999 00​:40​:30 -0000
Received​: by kiev.wall.org (8.9.3/8.9.3) id KAA09914;
  Mon, 8 Nov 1999 10​:00​:36 -0800 (PST)
Date​: Mon, 8 Nov 1999 10​:00​:36 -0800 (PST)
From​: Larry Wall <larry@​wall.org>
Message-Id​: <199911081800.KAA09914@​kiev.wall.org>
To​: ilya@​math.ohio-state.edu (Ilya Zakharevich)
Cc​: perl5-porters@​perl.org
Subject​: Re​: [ID 19991106.003] Re​: not(1) && 0 is true!
In-Reply-To​: <199911062047.PAA09734@​monk.mps.ohio-state.edu>
(from Ilya Zakharevich on Sat, 6 Nov 1999 15​:47​:30 -0500 (EST))

Ilya Zakharevich writes​:
: [A complimentary Cc of this posting was sent to Uri Guttman
: <uri@​sysarch.com>],
: who wrote in article <x7ln8b34dk.fsf@​home.sysarch.com>​:
: > different precedence covers that. not ($x) is an low precedence op
: > followed by a term. lc ($x) is a higher precedence unary op with an
: > arg.
:
: I very much doubt this description. You are missing "if it looks like
: a function call, it is a function call" rule (see C<print (1)>
: clause). lc has a very low precedence "on the right" as well.
:
: But somehow C<not> got through the cracks of this rule. This is most
: probably a bug (so I CC perlbug).

Sarathy put in a fix for this a month or so ago. Try it in _62.

Larry
---------- End of forwarded message --------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.