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
[BUG null conditionals should not be allowed] #879
Comments
From @schwern 1) Everything else (until, if, unless...) is a syntax error with an At minimum there should be a warning, at best it should be made a Here's another intersting problem: do { print "TRUE"; sleep 1 } while (); do { print "TRUE"; sleep 1 } until (); Again, the oddness: IMHO do {...} while () and do {...} until () should both be syntax Unless there's a backwards compatibility issue, all instances of an If I'm feeling brave I'll submit a patch. PS This problem occurs under 5.005_03 and 5.005_62 Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Characteristics of this binary (from libperl): Summary of my perl5 (revision 5.0 version 5 subversion 62) configuration: Characteristics of this binary (from libperl): -- Michael G Schwern schwern@pobox.com |
From @mjdominus
It's legal in a `for (;;)' loop. I guess that that is the reason.
Maybe because you're not thinking of for(;;)?
Make sure you don't break for(;;). |
From @TimToadyMark-Jason Dominus writes: Yes, that was the reason. Larry |
From [Unknown Contact. See original ticket]
What was the reason for if BLOCK BLOCK --tom |
From @andk
print "It always has been that way" while (); Oops. Well, "it always has been that way" is true for while(){}, the print "It always has been that way" while (1); # works I guess, the reason for that difference would be: Programmers like while (){ is kept for the time being. But for the .... while ...; construct there is no arguing because there is no last() that would -- |
From @TimToadyTom Christiansen writes: Premature senility. Postmature infantilism. Experimental error. Brain fart. There's a lesson here. Generalizations are generally useless unless used. Larry |
From [Unknown Contact. See original ticket]On Fri, Nov 19, 1999 at 04:17:04PM -0500, Michael G Schwern wrote:
While checking this out, I found a problem with B::Deparse: % perl -MO=Deparse -e 'while () { print }' Characteristics of this binary (from libperl): Peace, |
From @TimToadyAndreas J. Koenig writes: I think it has more to do with the fact that the statement has mandatory print while; just looks kinda strange. Whereas while(){} is more like for(;;){}. Plus I remember being impressed with Ada because you could write an Larry |
From [Unknown Contact. See original ticket]Mark-Jason Dominus writes:
Frankly speaking, if I see `while' I prefer thinking about 'while', Ilya |
From @TimToadyIlya Zakharevich writes: Eh? It was explicitly coded into parser on purpose. It wasn't an In fact, if you go back to the Perl 1 source code, you'll see that It's just another one of those early generalizations that never quite Larry |
From [Unknown Contact. See original ticket]On Fri, Nov 19, 1999 at 03:56:32PM -0800, Larry Wall wrote:
Should not it go the same as the other one: perl -wle 'if {1} {print 12}' Ilya |
From @TimToadyIlya Zakharevich writes: Why? I didn't say live and learn, I said live and let learn. :-) Larry |
From [Unknown Contact. See original ticket]On Fri, Nov 19, 1999 at 04:09:33PM -0800, Larry Wall wrote:
The same because as for if {1} {print 12}? Ilya |
From @TimToadyIlya Zakharevich writes: There was no because. We broke "if {1}" totally by accident, and only Larry |
From [Unknown Contact. See original ticket]On Fri, Nov 19, 1999 at 04:31:31PM -0800, Larry Wall wrote:
Misprint? ;-) Ilya |
From @vanstynIn <sfc7ljekva5.fsf@hohenstaufen.in-berlin.de>, Andreas J. Koenig writes: I think this is more likely due to the fact that in the modifier form, Hugo |
Migrated from rt.perl.org#1811 (status was 'resolved')
Searchable as RT1811$
The text was updated successfully, but these errors were encountered: