-
Notifications
You must be signed in to change notification settings - Fork 574
parser bug: print not (1,2,3)[0] #912
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
Comments
From @andkperl -e 'print not (1,2,3)[0];' This was legal up to perl5.005_03. I found this while trying to compile DBD::XBase for devel releases. Perl Info
|
From @gsarOn Fri, 03 Dec 1999 13:05:25 +0100, "Andreas J. Koenig" wrote:
I'm not sure how serious a compatibility issue this will be. Sarathy Inline Patch-----------------------------------8<-----------------------------------
Change 4673 by gsar@auger on 1999/12/09 04:00:23
document compatibility issue with literal list slices and NOTOP
(C<not (1,2,3)[0]> is now a syntax error)
Affected files ...
... //depot/perl/pod/perldelta.pod#118 edit
Differences ...
==== //depot/perl/pod/perldelta.pod#118 (text) ====
Index: perl/pod/perldelta.pod
--- perl/pod/perldelta.pod.~1~ Wed Dec 8 20:00:28 1999
+++ perl/pod/perldelta.pod Wed Dec 8 20:00:28 1999
@@ -125,6 +125,28 @@
has been removed, because it could potentially result in memory
leaks.
+=item Parenthesized not() behaves like a list operator
+
+The C<not> operator now falls under the "if it looks like a function,
+it behaves like a function" rule.
+
+As a result, the parenthesized form can be used with C<grep> and C<map>.
+The following construct used to be a syntax error before, but it works
+as expected now:
+
+ grep not($_), @things;
+
+On the other hand, using C<not> with a literal list slice may not
+work. The following previously allowed construct:
+
+ print not (1,2,3)[0];
+
+needs to written with additional parentheses now:
+
+ print not((1,2,3)[0]);
+
+The behavior remains unaffected when C<not> is not followed by parentheses.
+
=back
=head2 C Source Incompatibilities
End of Patch. |
From @andk
I have compiled 100s of CPAN modules after that change and so it seems
-- |
Migrated from rt.perl.org#1847 (status was 'resolved')
Searchable as RT1847$
The text was updated successfully, but these errors were encountered: