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
perlop: mention why 'print !!0' doesn't #7747
Comments
From @jidanniOn perlop, perhaps add an explanation of why |
From @smpetersOn Tue, Jan 11, 2005 at 10:22:20PM -0000, Dan Jacobson wrote:
It prints something for me. Steve Peters |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Tue, Jan 11, 2005 at 10:22:20PM -0000, Dan Jacobson wrote:
Are you specicifally concerned with any peculairies of a double !!, or -- |
From @tamiasOn Tue, Jan 11, 2005 at 05:06:36PM -0600, Steve Peters wrote:
That's your shell expanding the exclamation marks, silly. Try bash C<print !!0> prints nothing because the false value returned by logical Ronald |
From @nwc10On Tue, Jan 11, 2005 at 05:06:36PM -0600, Steve Peters wrote:
I do not think that you are using the same operating system (or at least Nicholas Clark |
From @jidanniD> C<print !!0> prints nothing because the false value returned by logical OK, mention something like that on perlop then, as beginners can't |
From @samvDan Jacobson wrote:
Dan, I highly recommend _Programming Perl, 3rd edition_. The first few You seem to be disputing things that most people on the list would If you want consistent, predictable and boring, the python camp is Sam |
From @jidanniD> I highly recommend _Programming Perl, 3rd edition_. I'm located far away so getting more books are inconvenient. Anyways I Though I'm not it the lunar lander, one hopes that the basic included Anyway, where ! is described, it seems reasonable to mention what its D> If you want consistent, predictable and boring, the python camp is Hard to mash into one-liners for use in Makefiles. |
From @iabynOn Tue, Jan 18, 2005 at 03:52:18AM +0800, Dan Jacobson wrote:
Okay, I'm going to be rude (again). Please go away. Please stop using the perlbug system for logging documentation enhancement I have better things to do with my time than replying to this crap. Dave. -- |
From @smpeters
While I agree that an explanation of why "print !!0" doesn't work isn't needed (take a look at I've got a start on an explanation of what is TRUE or FALSE in Perl. My question is should it |
From @tamiasOn Tue, Feb 01, 2005 at 05:34:18PM -0000, Steve Peters via RT wrote:
perldoc perlsyn: Truth and Falsehood The number 0, the strings '0' and '', the empty list "()", and "undef" Is that sufficient? I'm not sure what you mean by "the rest". Ronald |
From @pjcjOn Tue, Feb 01, 2005 at 05:34:18PM -0000, Steve Peters via RT wrote:
There's a short section entitled "Truth and Falsehood" in perlsyn that's -- |
From @nwc10On Tue, Feb 01, 2005 at 12:41:27PM -0500, Ronald J Kimball wrote:
The fact that the value returned for "false" is the string "", but the $ perl -wle 'print ">$_< ", $_ + 0 foreach 1==1, 1!=1'
And note that it's a dual value - it's not actually a regular empty string: $ perl -wle 'print ">$_< ", $_ + 0 foreach "1", ""'
Nicholas Clark |
From @smpeters
The following patch should clear up this special false value. Inline Patch--- perlsyn.pod.old Fri Oct 10 15:20:53 2003
+++ perlsyn.pod Wed May 11 11:56:47 2005
@@ -105,6 +105,9 @@
The number 0, the strings C<'0'> and C<''>, the empty list C<()>, and
C<undef> are all false in a boolean context. All other values are true.
+Negation of a true value by C<!> or C<not> returns a special false value.
+When evaluated as a string it is treated as C<''>, but as a number, it
+is treated as 0.
=head2 Statement Modifiers |
From @iabynOn Wed, May 11, 2005 at 04:58:22PM -0000, Steve Peters via RT wrote:
of course, it's not just '!', several ops have the ability to return the We really need a separate paragrah at the top of perlop describing the -- |
From @smpeters
So, do we need a section that explains just the false value or one that |
From @iabynOn Fri, Jun 09, 2006 at 01:03:29PM -0700, Steve Peters via RT wrote:
The latter I think. -- |
From @doyThis was done as part of 1ca345e. perlop now contains: Perl operators that return true or false generally return values -doy |
From [Unknown Contact. See original ticket]This was done as part of 1ca345e. perlop now contains: Perl operators that return true or false generally return values -doy |
@doy - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#33765 (status was 'resolved')
Searchable as RT33765$
The text was updated successfully, but these errors were encountered: