@@ -19,8 +19,8 @@ DRAFT: Synopsis 32: Setting Library - Containers.pod
19
19
20
20
Created: 19 Feb 2009 extracted from S29-functions.pod
21
21
22
- Last Modified: 13 Jul 2013
23
- Version: 40
22
+ Last Modified: 3 Aug 2013
23
+ Version: 41
24
24
25
25
If you read the HTML version, it is generated from the Pod in the specs
26
26
repository under
@@ -453,9 +453,10 @@ C<is canonicalized(&lc)>.)
453
453
454
454
multi sub uniq(*@values --> Positional:D, :&with = &[===])
455
455
456
- Returns a list of unique values from the invocant/argument
457
- list. The order of the original list is preserved
458
- even as duplicates are removed.
456
+ Returns a list of unique values from the invocant/argument list, such
457
+ that only the first occurrence of each duplicated value remains in the
458
+ result list. The order of the original list is preserved even as
459
+ duplicates are removed.
459
460
460
461
say <a a b b b c c>.uniq # a b c
461
462
say <a b b c c b a>.uniq # a b c
@@ -477,10 +478,10 @@ objects are adjacent.)
477
478
multi sub squish(*@values --> Positional:D, :&with = &[===])
478
479
479
480
Returns a list of values from the invocant/argument list where runs
480
- of more than one object of the same identity are squished down to
481
- a single instance. Unlike C<uniq>, this function only removes adjacent
482
- duplicates; identical objects further apart are still kept. The order of the
483
- original list is preserved even as duplicates are removed.
481
+ of more than one value are replaced with only the first instance.
482
+ Unlike C<uniq>, this function only removes adjacent duplicates; identical
483
+ values further apart are still kept. The order of the original list is
484
+ preserved even as duplicates are removed.
484
485
485
486
say <a a b b b c c>.squish # a b c
486
487
say <a b b c c b a>.squish # a b c b a
0 commit comments