Skip to content

Commit 92d7bd5

Browse files
committed
Move :exists and :delete to new Data Structures section
1 parent 928c6c5 commit 92d7bd5

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

lib/Language/5to6.pod

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,23 +208,6 @@ I<Key/value-slicing an array variable>
208208
say join ',', @months[6, 8..11]:kv; # Perl 6 - % becomes @; slice controlled by adverb
209209
=end item
210210
211-
Some functions for manipulating hashes and querying hash values have been
212-
turned into adverbs:
213-
214-
=begin item
215-
I<Checking for element existence in a hash>
216-
217-
say "element exists" if exists $hash{$key}; # Perl 5
218-
say "element exists" if %hash{$key}:exists; # Perl 6 - exists controlled by adverb
219-
=end item
220-
221-
=begin item
222-
I<Deleting an element in a hash>
223-
224-
my $deleted_value = delete $hash{$key}; # Perl 5
225-
my $deleted_value = %hash{$key}:delete; # Perl 6 - delete controlled by adverb
226-
=end item
227-
228211
=head4 C<&> Sub
229212
230213
In Perl 6, the C<&> sigil is used consistently (and without the help of
@@ -575,8 +558,31 @@ translation.
575558
In scalar context, C<..> and C<...> were the little-known Flipflop
576559
operators. They have been replaced by C<ff> and C<fff>.
577560
561+
=head2 Data Structures
562+
563+
=head3 Arrays and Lists
578564
565+
=head3 Hashes
579566
567+
As mentioned above in the section on L<#Sigils>, hashes in Perl 6 are always
568+
prefixed with a C<%>.
569+
570+
Some functions for manipulating hashes and querying hash values have been
571+
turned into adverbs:
572+
573+
=begin item
574+
I<Checking for element existence in a hash>
575+
576+
say "element exists" if exists $hash{$key}; # Perl 5
577+
say "element exists" if %hash{$key}:exists; # Perl 6 - exists controlled by adverb
578+
=end item
579+
580+
=begin item
581+
I<Deleting an element in a hash>
582+
583+
my $deleted_value = delete $hash{$key}; # Perl 5
584+
my $deleted_value = %hash{$key}:delete; # Perl 6 - delete controlled by adverb
585+
=end item
580586
581587
=head2 Compound Statements
582588

0 commit comments

Comments
 (0)