Author: lwall
Date: 2009-06-17 21:08:15 +0200 (Wed, 17 Jun 2009)
New Revision: 27106
Modified:
docs/Perl6/Spec/S02-bits.pod
Log:
[S02] define utf constrained buffer types
[S02] nail down canonical name for instantiated types to use ident adverbial
(MyRole[MyType] still instantiates, but isn't the name of the resulting type)
Modified: docs/Perl6/Spec/S02-bits.pod
===
--- docs/Perl6/Spec/S02-bits.pod2009-06-17 18:49:52 UTC (rev 27105)
+++ docs/Perl6/Spec/S02-bits.pod2009-06-17 19:08:15 UTC (rev 27106)
@@ -12,8 +12,8 @@
Maintainer: Larry Wall la...@wall.org
Date: 10 Aug 2004
- Last Modified: 2 Jun 2009
- Version: 170
+ Last Modified: 17 Jun 2009
+ Version: 171
This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
@@ -464,7 +464,9 @@
name of the resulting type, so one CArray of Int is equivalent to
another CArray of Int. (Another way to look at it is that the type
instantiation factory is memoized.) Typename aliases are considered
-equivalent to the original type.
+equivalent to the original type. In particular, the CArray of Int syntax
+is just sugar for CArray:of(Int), which is the canonical form of an
+instantiated generic type.
This name equivalence of parametric types extends only to parameters
that can be considered immutable (or that at least can have an
@@ -800,6 +802,26 @@
=item *
+The Cutf8 type is derived from Cbuf8, with the additional constraint
+that it may only contain validly encoded UTF-8. Likewise, Cutf16 is
+derived from Cbuf16, and Cutf32 from Cbuf32.
+
+Note that since these are type names, parentheses must always be
+used to call them as coercers, since the listop form is not allowed
+for coercions. That is:
+
+utf8 op $x
+
+is always parsed as
+
+(utf8) op $x
+
+and never as
+
+utf8(op $x)
+
+=item *
+
The C* character as a standalone term captures the notion of
Whatever, which is applied lazily by whatever operator it is an
argument to. Generally it can just be thought of as a glob that
@@ -1163,7 +1185,7 @@
actually means:
-my Hash[Array[Recipe]] %book;
+my Hash:of(Array:of(Recipe)) %book;
Because the actual variable can be hard to find when complex types are
specified, there is a postfix form as well:
@@ -1215,6 +1237,10 @@
my Cat|Dog Fish $mitsy = new Fish but { Bool.pick ?? .does Cat
!! .does Dog };
+[Note: the above is a slight lie, insofar as parameters are currently
+restricted for 6.0.0 to having only a single main type for the
+formal variable until we understand MMD a bit better.]
+
=head2 Parameter types
Parameters may be given types, just like any other variable: