Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make $x++ return 0 on appropriate undefs
Since the operator is doing something defined, the first
value it returns should also be defined.
  • Loading branch information
TimToady committed Dec 10, 2010
1 parent b578b58 commit ef12f7f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions S03-operators.pod
Expand Up @@ -15,8 +15,8 @@ Synopsis 3: Perl 6 Operators

Created: 8 Mar 2004

Last Modified: 23 Sep 2010
Version: 220
Last Modified: 10 Dec 2010
Version: 221

=head1 Overview

Expand Down Expand Up @@ -543,6 +543,12 @@ previously incremented. This is useful if your C<%seen> hash is
actually a C<KeySet>, in which case decrement actually deletes it
from the C<KeySet>.

Increment/decrement of an undefined C<Numeric>, C<Cool>, or C<Any> variable
sets the variable to 0 and then performs the increment/decrement. Hence a
postincrement returns 0 the first time:

my $x; say $x++; # 0, not Any

=over

=item *
Expand Down

0 comments on commit ef12f7f

Please sign in to comment.