@@ -208,23 +208,6 @@ I<Key/value-slicing an array variable>
208
208
say join ',', @months[6, 8..11]:kv; # Perl 6 - % becomes @; slice controlled by adverb
209
209
= end item
210
210
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
-
228
211
= head4 C < & > Sub
229
212
230
213
In Perl 6, the C < & > sigil is used consistently (and without the help of
@@ -575,8 +558,31 @@ translation.
575
558
In scalar context, C < .. > and C < ... > were the little-known Flipflop
576
559
operators. They have been replaced by C < ff > and C < fff > .
577
560
561
+ = head2 Data Structures
562
+
563
+ = head3 Arrays and Lists
578
564
565
+ = head3 Hashes
579
566
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
580
586
581
587
= head2 Compound Statements
582
588
0 commit comments