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
print/printf/say/sort (...) interpreted as function limited to " " as a whitespace in front of "(" #13949
Comments
From @avarCreated by @avarThis is a minor bug that's been present ever since the perl 4 era. We $ ./perl -we 'print("")' But this is warned about: $ ./perl -we 'print ("")' However S_checkcomma() in toke.c that implements this just does: if (*s == ' ' && s[1] == '(') { /* XXX gotta be a better way */ So we will only catch cases of /\b(?:print|printf|say|sort) \(/, but The function already uses the correct isSPACE() macro later on, the Perl Info
|
From @jkeenanOn Sat Jun 21 06:29:01 2014, avar wrote:
If we've lived with this bug for 20 years, I imagine some would say, "Why can't we live with it for another 20 years?" More to the point, what might break if we fixed it? Could you provide tests that would demonstrate that the bug is fixed if we do decide to fix it? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @avarOn Sun, Jun 29, 2014 at 3:11 AM, James E Keenan via RT
It's certainly not very high priority, just something I noticed while
The behavior of the parser would still be the same, it would just warn
Since the warning literally checks for " " followed by "(" but should But as long is it's using the isSPACE() macro instead of the current |
From @TuxOn Sun, 29 Jun 2014 12:58:07 +0200, Ævar Arnfjörð Bjarmason
I agree with Abigail that this could be nominated to one of the worst In *my* perception the warning is the wrong way round. Just remove the warning completely.
Fix it by removing the warning.
-- |
From @ikegamiOn Sun, Jun 29, 2014 at 8:16 AM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
C<< print( ($x+2)*5 ); >> should warn??? You probably mean that C<< print ($x+2)*5; >> should mean C<< print Just remove the warning completely. We use to get lots of questions about print print the wrong stuff. We don't |
From @TuxOn Sun, 29 Jun 2014 13:28:32 -0400, Eric Brine <ikegami@adaelis.com>
*my* preference for writing functions is to put a space between the Good: print (($x + 2) * 5); Feel free to disagree. That is part of the beauty of the language perl: it allows us to $x++ if $a; are exactly the same in the code, but part of us prefer the first in
It *never* warned me about what its warning is written for. -- |
From @avarIt wasn't a useful warning for you. But I think it's useful to step back I'm not saying we should keep this particular warning or any other warning.
|
From @avarI meant that "arguing on the basis of our own personal preference is an Can't we all agree that that's what we're ultimately aiming for?
|
From @TuxOn Sun, 29 Jun 2014 22:31:04 +0200, Ævar Arnfjörð Bjarmason
That is why I gave a counter-example for each of my reasonings I am well aware that Abigail and I are in the minority in this specific Keep that in mind when we *extend* the scope of a warning.
Wrong! That is where perl6 might have lost quite a number of good perl This is not that I say perl6 is not a good language. I see more and
-- |
From @demerphqOn 29 June 2014 22:26, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Personally I think this is the wrong debate. For me the way this warning is implemented is just wrong. As implemented I Were it to be implemented at a different level, when the user really did It reminds me of the old broken way we used to detect special cases in Yves |
From @cpansproutOn Mon Jun 30 00:07:08 2014, demerphq wrote:
Like OP_PRINT and a number being both children of a binop? I wonder: Why don’t void warnings already catch most of these cases? Or do they?
Heh. This reminds me of: $ perl -le 'my $a; sort @t; $a + $cmp;' :-) -- Father Chrysostomos |
Migrated from rt.perl.org#122150 (status was 'open')
Searchable as RT122150$
The text was updated successfully, but these errors were encountered: