Author: lwall
Date: 2009-12-03 20:00:40 +0100 (Thu, 03 Dec 2009)
New Revision: 29250
Modified:
docs/Perl6/Spec/S02-bits.pod
docs/Perl6/Spec/S12-objects.pod
docs/Perl6/Spec/S32-setting-library/Containers.pod
Log:
make pair values sequences both associative and positional
revise enum mixins to distinguish attribute vs method mixin
Modified: docs/Perl6/Spec/S02-bits.pod
===
--- docs/Perl6/Spec/S02-bits.pod2009-12-03 15:33:14 UTC (rev 29249)
+++ docs/Perl6/Spec/S02-bits.pod2009-12-03 19:00:40 UTC (rev 29250)
@@ -13,8 +13,8 @@
Created: 10 Aug 2004
-Last Modified: 23 Nov 2009
-Version: 192
+Last Modified: 3 Dec 2009
+Version: 193
This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
@@ -1151,7 +1151,7 @@
Set Unordered collection of values that allows no duplicates
Bag Unordered collection of values that allows duplicates
PairVal An immutable Pair
-PairValSet Set of PairVals with no duplicate keys
+PairValSeq Seq of PairVals with no duplicate keys
Signature Function parameters (left-hand side of a binding)
Parcel List of syntactic objects
Capture Function call arguments (right-hand side of a binding)
@@ -1206,7 +1206,7 @@
Set Associative[Bool]
Bag Associative[UInt]
PairVal Associative
-PairValSet Associative
+PairValSeq Associative Postional Iterable
Signature
Parcel Positional
Capture Positional Associative
@@ -1227,7 +1227,7 @@
KeySet KeyHash of Bool (does Set in list/array context)
KeyBag KeyHash of UInt (does Bag in list/array context)
PairA single key-to-value association
-PairSet A Set of Pairs
+PairSeq A Seq of Pairs
Buf Perl buffer (a stringish array of memory locations)
IO Perl filehandle
Routine Base class for all wrappable executable objects
@@ -1275,7 +1275,7 @@
replicated the number of times specified by its corresponding value.
(Use C<.kv> or C<.pairs> to suppress this behavior in list context.)
-As with C types, C and C are mutable in their
+As with C types, C and C are mutable in their
values but not in their keys. (A key can be a reference to a mutable
object, but cannot change its C<.WHICH> identity. In contrast,
the value may be rebound to a different object, just as a hash
@@ -1288,8 +1288,9 @@
HashAssociative
KeySet KeyHash[Bool]
KeyBag KeyHash[UInt]
+KeyHash Associative
PairAssociative
-PairSet Associative
+PairSeq Associative Postional Iterable
Buf Stringy
IO
Routine Callable
Modified: docs/Perl6/Spec/S12-objects.pod
===
--- docs/Perl6/Spec/S12-objects.pod 2009-12-03 15:33:14 UTC (rev 29249)
+++ docs/Perl6/Spec/S12-objects.pod 2009-12-03 19:00:40 UTC (rev 29250)
@@ -13,8 +13,8 @@
Created: 27 Oct 2004
-Last Modified: 28 Nov 2009
-Version: 93
+Last Modified: 3 Dec 2009
+Version: 94
=head1 Overview
@@ -1713,7 +1713,7 @@
3 ~~ Day# True, using Day as a subset of Int
Day.mapping # hash of key/value pairs
-The C<.mapping> method returns a C that may be used like
+The C<.mapping> method returns a C that may be used like
a constant hash value:
my enum CoinFace ;
@@ -1747,7 +1747,9 @@
%e = 1;
%e = 2;
-The enum installer inspects list values for pairs, where the value
+The return value of an anonymous enum is a c.
+
+The enum composer inspects list values for pairs, where the value
of the pair sets the next value explicitly. Non-pairs C<++> the
previous value. (Str and buf types increment like Perl 5 strings.)
Since the C<«...»> quoter automatically recognizes
@@ -1782,7 +1784,7 @@
or the old one.) Any explicit sub or type definition hides all imported
enum values of the same name but will produce a warning unless
C is included. Note that true() is a built-in function
-and requires an argument, while True is short for C and
+and requires an argument, while C is short for C and
does not take an argument.
Since non-native enum values know their enum type, they may be used to
@@ -1801,16 +1803,31 @@
An enum type is not in itself a role type; however, the C
and C operators know that when a user supplies an enum type,
it implies the generation of an anonymous mixin role that creates an
-attribute of the enum type along with an accessor. If we assume
-there is a C role that creates an attribute, then
+an appropriate accessor, read-write if an attribute is being created, and
+read-only otherwise. It depends on whether you mix in the whole
+or a specific enum value or the whole enum type:
+$x = "Today" but Tue;