Permalink
Browse files

mv "Truth and Falsehood" from perlsyn to perldata

This one-paragraph section didn't belong in perlsyn.  perldata already
had a paragraph on the topic; merge them.  [perl #115650]
  • Loading branch information...
Zefram
Zefram committed Nov 14, 2017
1 parent 258dae8 commit 77fae4394e3ad9f159a74a6731a8d347cd2466c7
Showing with 13 additions and 12 deletions.
  1. +6 −1 pod/perldata.pod
  2. +6 −0 pod/perldelta.pod
  3. +1 −11 pod/perlsyn.pod
View
@@ -320,12 +320,17 @@ are considered pretty much the same thing for nearly all purposes,
references are strongly-typed, uncastable pointers with builtin
reference-counting and destructor invocation.
X<truth> X<falsehood> X<true> X<false> X<!> X<not> X<negation> X<0>
X<boolean> X<bool>
A scalar value is interpreted as FALSE in the Boolean sense
if it is undefined, the null string or the number 0 (or its
string equivalent, "0"), and TRUE if it is anything else. The
Boolean context is just a special kind of scalar context where no
conversion to a string or a number is ever performed.
X<boolean> X<bool> X<true> X<false> X<truth>
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. Most Perl operators
that return true or false behave this way.
There are actually two varieties of null strings (sometimes referred
to as "empty" strings), a defined one and an undefined one. The
View
@@ -290,6 +290,12 @@ rather than in terms of the physical data structures.
=item *
The section "Truth and Falsehood" in L<perlsyn> has been removed from
that document, where it didn't belong, and merged into the existing
paragraph on the same topic in L<perldata>.
=item *
XXX Description of the change here
=back
View
@@ -116,16 +116,6 @@ C<do {}> that I<look> like compound statements, but aren't--they're just
TERMs in an expression--and thus need an explicit termination when used
as the last item in a statement.
=head2 Truth and Falsehood
X<truth> X<falsehood> X<true> X<false> X<!> X<not> X<negation> X<0>
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. Most Perl operators
that return true or false behave this way.
=head2 Statement Modifiers
X<statement modifier> X<modifier> X<if> X<unless> X<while>
X<until> X<when> X<foreach> X<for>
@@ -304,7 +294,7 @@ language construct, as everyone reading your code will have to think at least
twice before they can understand what's going on.
The C<while> statement executes the block as long as the expression is
L<true|/"Truth and Falsehood">.
true.
The C<until> statement executes the block as long as the expression is
false.
The LABEL is optional, and if present, consists of an identifier followed

0 comments on commit 77fae43

Please sign in to comment.