Skip to content

Commit

Permalink
Move :exists and :delete to new Data Structures section
Browse files Browse the repository at this point in the history
  • Loading branch information
paultcochrane committed Feb 24, 2015
1 parent 928c6c5 commit 92d7bd5
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions lib/Language/5to6.pod
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,6 @@ I<Key/value-slicing an array variable>
say join ',', @months[6, 8..11]:kv; # Perl 6 - % becomes @; slice controlled by adverb
=end item
Some functions for manipulating hashes and querying hash values have been
turned into adverbs:
=begin item
I<Checking for element existence in a hash>
say "element exists" if exists $hash{$key}; # Perl 5
say "element exists" if %hash{$key}:exists; # Perl 6 - exists controlled by adverb
=end item
=begin item
I<Deleting an element in a hash>
my $deleted_value = delete $hash{$key}; # Perl 5
my $deleted_value = %hash{$key}:delete; # Perl 6 - delete controlled by adverb
=end item
=head4 C<&> Sub
In Perl 6, the C<&> sigil is used consistently (and without the help of
Expand Down Expand Up @@ -575,8 +558,31 @@ translation.
In scalar context, C<..> and C<...> were the little-known Flipflop
operators. They have been replaced by C<ff> and C<fff>.
=head2 Data Structures
=head3 Arrays and Lists
=head3 Hashes
As mentioned above in the section on L<#Sigils>, hashes in Perl 6 are always
prefixed with a C<%>.
Some functions for manipulating hashes and querying hash values have been
turned into adverbs:
=begin item
I<Checking for element existence in a hash>
say "element exists" if exists $hash{$key}; # Perl 5
say "element exists" if %hash{$key}:exists; # Perl 6 - exists controlled by adverb
=end item
=begin item
I<Deleting an element in a hash>
my $deleted_value = delete $hash{$key}; # Perl 5
my $deleted_value = %hash{$key}:delete; # Perl 6 - delete controlled by adverb
=end item
=head2 Compound Statements
Expand Down

0 comments on commit 92d7bd5

Please sign in to comment.