diff --git a/doc/Language/setbagmix.pod6 b/doc/Language/setbagmix.pod6 index 88890943e..b24be57cd 100644 --- a/doc/Language/setbagmix.pod6 +++ b/doc/Language/setbagmix.pod6 @@ -4,22 +4,31 @@ =SUBTITLE Unordered collections of unique and weighted objects in Perl 6 +=head1 Introduction + +The six collection classes are L, L, +L, L, L and +L. They all share similar semantics. + In a nutshell, these classes hold, in general, unordered collections of objects, much like an L. The L role is the role that is implemented by all of these classes: therefore they are also referenced as Ces. +C and C also implement the L role, +C and C implement the L role, C and +C implement the L role (which itself implements +the C role). + Sets only consider if objects in the collection are present or not, bags can hold several objects of the same kind, and mixes also allow fractional (and negative) weights. The regular versions are immutable, the I versions are mutable. -Let's elaborate on that. If you want to collect objects in a container buti -you do not care about the order of these objects, Perl 6 provides the -I collection types L, -L, L, L, -L, and L. Being unordered, these -containers can be more efficient than L for looking up +Let's elaborate on that. If you want to collect objects in a container but +you do not care about the order of these objects, Perl 6 provides these +I collection types. Being unordered, these containers can be more +efficient than L or L for looking up elements or dealing with repeated items. On the other hand, if you want to get the contained objects (elements) @@ -49,12 +58,6 @@ Use the mutable variants L, L, and L if you want to add or remove elements after the container has been constructed. -The six collection classes C, C, C, C, C, -C, all share similar semantics. C and C implement -the L role, C and C implement the -L role, C and C implement the -L role (which implements the C role). - For one thing, as far as they are concerned, identical objects refer to the same element – where identity is determined using the L method (i.e. the same way that the L<===> operator checks identity). For value