[svn:perl6-synopsis] r13577 - doc/trunk/design/syn

2007-02-08 Thread larry
Author: larry
Date: Thu Feb  8 13:52:24 2007
New Revision: 13577

Modified:
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S05.pod
   doc/trunk/design/syn/S06.pod
   doc/trunk/design/syn/S12.pod

Log:
Unified proto processing to implicitly allow redeclarations within scope.
This works on most declarators, including regex, token, rule, and variables.
Multiple my declarations warn about redeclaration as suggested by lukastic++.
This may be suppressed with a proto declaration of the variable.
The multi keyword is now optional in the scope of a proto.
The unique keyword now undoes an outer proto.


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podThu Feb  8 13:52:24 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 29 Jan 2007
+  Last Modified: 8 Feb 2007
   Number: 4
-  Version: 50
+  Version: 51
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -75,6 +75,15 @@
 my $x;
 my $x;
 
+By default the second declaration will get a compiler warning.
+You may suppress this by modifying the first declaration
+with Cproto:
+
+my proto $x;
+...
+while my $x = @x.shift {...}  # no warning
+while my $x = @x.shift {...}  # no warning
+
 If you've referred to C$x prior to the first declaration, and the compiler
 tentatively bound it to C$OUTER::x, then it's an error to declare it, and
 the compiler is required to complain at that point.  If such use can't

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podThu Feb  8 13:52:24 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 5 Feb 2007
+   Last Modified: 8 Feb 2007
Number: 5
-   Version: 50
+   Version: 51
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -670,17 +670,19 @@
 
 =item *
 
-Alternatively, if you predeclare a category, you can write multiple
-rules for the same category, differentiated only by the symbol they
+Alternatively, if you predeclare a proto regex, you can write multiple
+regexes for the same category, differentiated only by the symbol they
 match:
 
-category sigil;
-token sigil { :$ }
-token sigil { :@ }
-token sigil { :@@ }
-token sigil { :% }
-token sigil { : }
-token sigil { ::: }
+proto token sigil;
+multi token sigil { :$ }
+multi token sigil { :@ }
+multi token sigil { :@@ }
+multi token sigil { :% }
+multi token sigil { : }
+multi token sigil { ::: }
+
+(The Cmulti is optional and generally omitted with a grammar.)
 
 This can be viewed as a form of multiple dispatch, except that it's
 based on longest-token matching rather than signature matching.  The
@@ -688,6 +690,11 @@
 rules to the same category in a derived grammar.  All of them will
 be matched in parallel when you try to match C /sigil/ .
 
+If there are formal parameters on multi regex methods, matching
+still proceeds via longest-token rules first.  If that results in a
+tie, a normal multiple dispatch is made using the arguments to the
+remaining variants, assuming they can be differentiated by type.
+
 =item *
 
 An interpolated hash matches the longest possible token.  The match

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podThu Feb  8 13:52:24 2007
@@ -58,7 +58,11 @@
 
 BPrototypes (keyword: Cproto) specify the commonalities (such
 as parameter names, fixity, and associativity) shared by all multis
-of that name in the scope of the Cproto declaration.
+of that name in the scope of the Cproto declaration.  A Cproto
+also forces all routines of the same short name within the scope to
+be considered Cmulti whether they are explicitly declared so or not.
+(This is particularly useful when adding to rule sets or when attempting
+to compose conflicting methods from roles.)
 
 A modifier keyword may occur before the routine keyword in a named routine:
 

Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podThu Feb  8 13:52:24 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 3 Feb 2007
+  Last Modified: 8 Feb 2007
   Number: 12
-  Version: 38
+  Version: 39
 
 =head1 Overview
 
@@ -729,7

[svn:perl6-synopsis] r13578 - doc/trunk/design/syn

2007-02-08 Thread larry
Author: larry
Date: Thu Feb  8 18:18:06 2007
New Revision: 13578

Modified:
   doc/trunk/design/syn/S02.pod

Log:
typo from dataweaver++


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Feb  8 18:18:06 2007
@@ -2612,7 +2612,7 @@
 
 @result = @x.grep:{...};
 
-However, this Ilist() comprehension is strictly a syntactic transformation,
+However, this Ieach() comprehension is strictly a syntactic transformation,
 so a list computed any other way will not triger the rewrite:
 
 @result = (@x = each(@y)) ~~ {...}; # not a comprehension


[svn:perl6-synopsis] r13579 - doc/trunk/design/syn

2007-02-08 Thread larry
Author: larry
Date: Thu Feb  8 18:27:11 2007
New Revision: 13579

Modified:
   doc/trunk/design/syn/S02.pod

Log:
typo from all_beryb++ :)


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Feb  8 18:27:11 2007
@@ -2613,7 +2613,7 @@
 @result = @x.grep:{...};
 
 However, this Ieach() comprehension is strictly a syntactic transformation,
-so a list computed any other way will not triger the rewrite:
+so a list computed any other way will not trigger the rewrite:
 
 @result = (@x = each(@y)) ~~ {...}; # not a comprehension
 


[svn:perl6-synopsis] r13580 - doc/trunk/design/syn

2007-02-09 Thread larry
Author: larry
Date: Fri Feb  9 12:40:08 2007
New Revision: 13580

Modified:
   doc/trunk/design/syn/S12.pod

Log:
Changed unique to only and further explicated the proto/multi orthogon.
Normal user subs now again behave as only with respect to global protos.


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podFri Feb  9 12:40:08 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 8 Feb 2007
+  Last Modified: 9 Feb 2007
   Number: 12
-  Version: 39
+  Version: 40
 
 =head1 Overview
 
@@ -732,32 +732,47 @@
 declared Cmulti.  (Putting Cproto on the first such declaration has
 the same effect, but usually you want to put the Cmulti explicitly
 anyway for documentation.)  If a sub (or method) is not marked
-with Cmulti or within the scope of a Cproto, it is considered a
-Iunique sub.  You may mark a sub explicitly as Cunique as well, if
-you're worried it might be within the scope of a Cproto, and want there
-to be only one such routine within this scope.
-
-A unique sub (or method) doesn't share
-with anything outside of it or declared prior to it.  Only one such
-sub (or method) can inhabit a given namespace, and it hides any outer
-subs (or less-derived methods) of the same short name.  It may share
-with multis declared after it in the same scope if declared with the
-keyword Cproto, but in that case it functions only as the final
-tie-breaker if the inner multies can't decide among themselves what
-to do.  (It may then, of course, decide to redispatch outside of the
-current scope.)  The signature of such a proto-multi also nails down
-the presumed order and naming of positional parameters, so that any
-multi call with named arguments in that scope can presume to rearrange
-those arguments into positional parameters based on that information.
-(Unrecognized names remain named arguments.)
+with Cmulti and it is not within the package or lexical scope of
+a Cproto of the same short name, it is considered unique, an Ionly
+sub.  You may mark a sub explicitly as Conly if you're worried it
+might be within the scope of a Cproto, and you want to suppress
+any other declarations within this scope.  An Conly sub (or method)
+doesn't share with anything outside of it or declared prior to it.
+Only one such sub (or method) can inhabit a given namespace, and it
+hides any outer subs (or less-derived methods) of the same short name.
+
+The default Cproto declarations provided by Perl from the global scope
+are Inot propagated to the user's scope unless explicitly imported,
+so a Csub declaration there that happens to be the same as a global
+multi is considered Conly unless explicitly marked Cmulti.
+
+A Cproto may share with multis declared after it in the same scope,
+but in that case it functions only as the final tie-breaker if the
+inner multies can't decide among themselves what to do.  (It may
+then, of course, decide to redispatch outside of the current scope.)
+The signature of such a proto-multi also nails down the presumed order
+and naming of positional parameters, so that any multi call with named
+arguments in that scope can presume to rearrange those arguments into
+positional parameters based on that information.  (Unrecognized names
+remain named arguments.)  Any other type information or traits attached
+to the Cproto are also shared by the routines within its scope,
+so a Cproto definition can be used to factor out common traits.
+This is particularly useful for establishing grammatical categories
+in a grammar be declaring a Cproto Ctoken or Crule.  (Perl 6's
+grammar does this, for instance.)
+
+You can have multiple Cmulti variables in the same scope, and they
+all share the same storage location and type.  Usually these are
+declared by one Cproto declaration at the top, and leaving the
+Cmulti implicit on the rest of the declarations.
 
-For subs or methods declared Cmulti, only one instance of the long
-name can be in any namespace, and it hides any outer (or less-derived)
+In contrast, Cmulti routines can have only one instance of the long
+name in any namespace, and that instance hides any outer (or less-derived)
 routines with the same long name.  It does not hide any routines with
 the same short name but a different long name.  In other words, multis
 with the same short name can come from several different namespaces
 provided their long names differ and their short names aren't hidden
-by a non-multi declaration in some intermediate scope.
+by an Conly declaration in some intermediate scope.
 
 When you call a routine with a particular short name, if there are
 multiple visible long names, they are all considered candidates.


[svn:perl6-synopsis] r13581 - doc/trunk/design/syn

2007-02-10 Thread larry
Author: larry
Date: Sat Feb 10 09:19:39 2007
New Revision: 13581

Modified:
   doc/trunk/design/syn/S12.pod

Log:
Right ye be, Daniel Hulme me matey!


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podSat Feb 10 09:19:39 2007
@@ -758,7 +758,7 @@
 to the Cproto are also shared by the routines within its scope,
 so a Cproto definition can be used to factor out common traits.
 This is particularly useful for establishing grammatical categories
-in a grammar be declaring a Cproto Ctoken or Crule.  (Perl 6's
+in a grammar by declaring a Cproto Ctoken or Cproto Crule.  (Perl 6's
 grammar does this, for instance.)
 
 You can have multiple Cmulti variables in the same scope, and they


[svn:perl6-synopsis] r13582 - doc/trunk/design/syn

2007-02-11 Thread larry
Author: larry
Date: Mon Feb 12 00:10:05 2007
New Revision: 13582

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S06.pod

Log:
The kludge known as leave is now spelled give.
The give() function always gives the final value of the innermost block.
The $context.give() method always gives the final value of the context.
Rather than repeating the context selector interface we now rely on object.
Loop labels are now considered sufficient OO to allow LABEL.give($retval)
within the *lexical* scope of the labeled statement.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon Feb 12 00:10:05 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 8 Feb 2007
+  Last Modified: 11 Feb 2007
   Number: 2
-  Version: 85
+  Version: 86
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -2468,7 +2468,21 @@
 
 The lexical routine itself is C?ROUTINE; you can get its name with
 CROUTINE.name.  The current block is C?BLOCK.  If the block has a label,
-that shows up in C?BLOCK.label.
+that shows up in C?BLOCK.label.  Within the lexical scope of
+a statement with a label, the label is a pseudo-object representing
+the dynamic context of that statement.  (If inside multiple dynamic
+instances of that statement, the label represents the innermost one.)
+When you say:
+
+next LINE;
+
+it is really a method on this pseudo-object, and
+
+LINE.next;
+
+would work just as well.  You can exit any labeled block early by saying
+
+MyLabel.give(@results);
 
 =item *
 

Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podMon Feb 12 00:10:05 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 8 Feb 2007
+  Last Modified: 11 Feb 2007
   Number: 4
-  Version: 51
+  Version: 52
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -204,7 +204,8 @@
 within the body of the loop.  See below.
 
 The value of a loop statement is the list of values from each
-iteration.  (This list is actually a multidimensional list (a multislice)
+iteration that successfully completed without a Cnext or Clast.
+(This list is actually a multidimensional list (a multislice)
 with dimensional boundaries at each iteration.  Most list contexts
 ignore these boundaries and flatten the list.)  If you do not wish
 to accidentally return a list from the final loop statement in a
@@ -651,26 +652,49 @@
 with the Csub, Cmethod, or Csubmethod keywords).  Pointy blocks
 and bare closures are transparent to Creturn.  If you pass a closure
 object outside of its official sub scope, it is illegal to
-return from it.  You may only leave the closure block itself with Cleave
-or by falling off the end of it.
+return from it.  You may only leave the displaced closure block itself
+by falling off the end of it or by explicitly calling Cgive.
 
-To return a value from a pointy block or bare closure, you either
-just let the block return the value of its final expression, or you can
-use Cleave.  A Cleave by default exits from the innermost block.
-But you may change the behavior of Cleave with a selector as the
-first argument:
+To return a value from any pointy block or bare closure, you either
+just let the block return the value of its final expression, or you
+can use Cgive, which comes in both function and method forms.
+The function (or listop) form always exits from the innermost block,
+returning its arguments as the final value of the block exactly as
+return does.  The method form will leave any block in the dynamic
+scope that can be named as an object and that responds to the C.give
+method.
 
-leave Loop where { .label ~~ 'LINE' }, 1,2,3;
+Hence, the Cgive function:
 
-The innermost block matching the selection criteria will be exited.
-The return value, if any, must be passed as the second and subsequent 
arguments.
-To return pairs as part of the value, you can use a feed operator:
+give(1,2,3)
 
-leave == :foo:bar:baz(1) if $leaving;
+is really just short for:
 
-or going the other way:
+$?BLOCK.give(1,2,3)
 
-$leaving and :foo:bar:baz(1) == leave;
+To return from your immediate caller, you can say:
+
+caller.give(1,2,3)
+
+Further contexts up the caller stack may be located by the selector
+that is built into the Ccaller function itself:
+
+caller({ .label eq 'LINE' }).give(1,2,3);
+
+By default the innermost dynamic scope matching the selection criteria
+will be exited.  This can be a bit cumbersome, so in the particular
+case

[svn:perl6-synopsis] r13583 - doc/trunk/design/syn

2007-02-12 Thread larry
Author: larry
Date: Mon Feb 12 10:01:18 2007
New Revision: 13583

Modified:
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S06.pod

Log:
Decided leave wasn't so bad after all, given the new syntax refactoring.
And give can easily be confused with given.  Please don't sue for whiplash.


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podMon Feb 12 10:01:18 2007
@@ -653,33 +653,33 @@
 and bare closures are transparent to Creturn.  If you pass a closure
 object outside of its official sub scope, it is illegal to
 return from it.  You may only leave the displaced closure block itself
-by falling off the end of it or by explicitly calling Cgive.
+by falling off the end of it or by explicitly calling Cleave.
 
 To return a value from any pointy block or bare closure, you either
 just let the block return the value of its final expression, or you
-can use Cgive, which comes in both function and method forms.
+can use Cleave, which comes in both function and method forms.
 The function (or listop) form always exits from the innermost block,
 returning its arguments as the final value of the block exactly as
 return does.  The method form will leave any block in the dynamic
-scope that can be named as an object and that responds to the C.give
+scope that can be named as an object and that responds to the C.leave
 method.
 
-Hence, the Cgive function:
+Hence, the Cleave function:
 
-give(1,2,3)
+leave(1,2,3)
 
 is really just short for:
 
-$?BLOCK.give(1,2,3)
+$?BLOCK.leave(1,2,3)
 
 To return from your immediate caller, you can say:
 
-caller.give(1,2,3)
+caller.leave(1,2,3)
 
 Further contexts up the caller stack may be located by the selector
 that is built into the Ccaller function itself:
 
-caller({ .label eq 'LINE' }).give(1,2,3);
+caller({ .label eq 'LINE' }).leave(1,2,3);
 
 By default the innermost dynamic scope matching the selection criteria
 will be exited.  This can be a bit cumbersome, so in the particular
@@ -687,7 +687,7 @@
 scope is considered a kind of pseudo object specifying a potential
 dynamic context.  If instead of the above you say:
 
-LINE.give(1,2,3)
+LINE.leave(1,2,3)
 
 it was always exit from your lexically scoped CLINE loop, even
 if some inner dynamic scope you can't see happens to also have that
@@ -707,7 +707,7 @@
 then that outer loop is the one that must be controlled.  In other words,
 it first tries this form:
 
-LINE.give(1,2,3)
+LINE.leave(1,2,3)
 
 If there is no such lexically scoped outer loop in the current subroutine,
 then a fallback search is made outward through the dynamic scopes in

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podMon Feb 12 10:01:18 2007
@@ -1713,7 +1713,7 @@
 #want.arity === 0
 #want.count === 2
 
-=head2 The Cgive function
+=head2 The Cleave function
 
 As mentioned above, a Creturn call causes the innermost surrounding
 subroutine, method, rule, token, regex (as a keyword) or macro to
@@ -1721,9 +1721,10 @@
 may be returned from.  You may not use Creturn to return from loops,
 bare blocks, pointy blocks, or quotelike operators such as Crx//.
 
-To return from these types of code structures, the Cgive method
-is used instead.  (It can be taken to mean either give up or
-bequeath as appropriate.)  The object specifies the scope to exit,
+To return from these types of code structures, the Cleave method
+is used instead.  (It can be taken to mean either go away from or
+bequeath to your successor as appropriate.)
+The object specifies the scope to exit,
 and the method's arguments specify the return value.  If the object
 is omitted (by use of the function or listop forms), the innermost
 block is exited.  Otherwise you must use something like Ccaller
@@ -1736,25 +1737,37 @@
 As with Creturn, the arguments are taken to be a CCapture holding the
 return values.
 
-give;  # return from innermost block of any kind
-caller(Method).give;   # return from innermost calling method
-?ROUTINE.give(1,2,3); # Return from current sub. Same as: return 1,2,3
-?ROUTINE.give == 1,2,3;  # same thing, force return as feed
-OUTER.give;# Return from OUTER label in lexical scope
-foo.give: 1,2,3;  # Return from innermost surrounding call to foo
+leave;  # return from innermost block of any kind
+caller(Method).leave;   # return from innermost calling method
+?ROUTINE.leave(1,2,3); # Return from current sub. Same as: return 
1,2,3
+?ROUTINE.leave == 1,2,3;  # same thing, force return as feed
+OUTER.leave

[svn:perl6-synopsis] r13584 - doc/trunk/design/syn

2007-02-12 Thread larry
Author: larry
Date: Mon Feb 12 17:24:42 2007
New Revision: 13584

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Rethink of loopy feed semantics requested by Smylers++


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podMon Feb 12 17:24:42 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 11 Feb 2007
+  Last Modified: 12 Feb 2007
   Number: 6
-  Version: 69
+  Version: 70
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -880,20 +880,36 @@
 (But note: feed operators have push semantics when the receiver is an array.
 Use assignment to get clear-first semantics.)
 
-Conjecture: these are probably impossible:
+Conjecture: the following are possible, but only if we are very careful
+to cut loose the old @data on the blunt end of the pipe before rebinding
+the pointy end:
 
-@data == grep { $_ % 2 } == eager @data;
-@data = do { grep { $_ % 2 } == eager @data; }
-@data := do { grep { $_ % 2 } == eager @data; }
+@data == grep { $_ % 2 } == @data;
+@data := do { grep { $_ % 2 } == @data; }
+
+And this would need to force an eager evaluation to a temporary
+list to work at all:
+
+@data = do { grep { $_ % 2 } == @data; }
+
+Otherwise it's the equivalent of the Unix newbie mistake:
+
+filter foo foo
+
+Arguably we could take the Unix approach and force the newbie to just
+learn to deal with it explicitly.  (Arguably this could also be construed
+as antisocial.)
 
 Leftward feeds are a convenient way of explicitly indicating the typical
 right-to-left flow of data through a chain of operations:
 
 @oddsquares = map { $_**2 }, sort grep { $_ % 2 }, @nums;
 
-# more clearly written as...
+# perhaps more clearly written as...
 
-@oddsquares = map { $_**2 } == sort == grep { $_ % 2 } == @nums;
+@oddsquares = do {
+map { $_**2 } == sort == grep { $_ % 2 } == @nums;
+}
 
 Rightward feeds are a convenient way of reversing the normal data flow in a
 chain of operations, to make it read left-to-right:


[svn:perl6-synopsis] r13585 - doc/trunk/design/syn

2007-02-13 Thread larry
Author: larry
Date: Tue Feb 13 23:07:00 2007
New Revision: 13585

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Got rid of quote declarator.  Just use a macro.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podTue Feb 13 23:07:00 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 11 Feb 2007
+  Last Modified: 13 Feb 2007
   Number: 2
-  Version: 86
+  Version: 87
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1958,67 +1958,20 @@
 :trans  Parse as transliteration
 :code   Quasiquoting
 
-Ordinarily the colon is required on adverbs, but the Cquote declarator
-allows you to combine any of the existing adverbial forms above
-without an intervening colon:
+You may omit the first colon by joining an initial 'Q', 'q', or 'qq' with
+a single short form adverb, which produces forms like:
 
-quote qw;   # declare a P5-esque qw// meaning q:w
-quote Qc;   # Q:c//, interpolate only closures
+qw /a b c/; # P5-esque qw// meaning q:w
+Qc '...{$x}...';# Q:c//, interpolate only closures
+qqx/$cmd @args/ # equivalent to P5's qx//
 
-Actually, those two are already assumed, because you get all of the
-forms that use a single character modifier predeclared for free.  (Note
-this means that Cqx// doesn't intepolate.)
+(Note that Cqx// doesn't intepolate.)
 
-If you want to abbreviate further, you may also give an explicit
-definition as either a string or quasiquote:
+If you want to abbreviate further, just define a macro:
 
-quote qx = 'qq:x';  # equivalent to P5's qx//
-quote qTO = 'qq:x:w:to';# qq:x:w:to//
-quote circumfix:❰ ❱ = q:code{ .quoteharder };  # or some such...
-
-In particular, all these forms disable the lookahead for an adverbial argument,
-as if there were a space after the keyword.  So although
-
-q:s($foo)
-
-will misinterpret C$foo as the C:s argument,
-
-qs(stuff)
-
-has the advantage of misinterpreting it as the argument to the Cqs()
-function instead.  C:)
-
-But parens are special that way.  (Even Cq() is assumed to be a
-function call rather than a quote.)  Other bracketing characters are
-special only if they can be mistaken for adverbial arguments, so
-
-qs[stuff]
-
-is fine, and means
-
-q:s /stuff/
-
-while
-
-q:s[stuff]
-
-also happens to work because quote adverbs only allow the paren form of
-bracketed adverbs.
-
-If this is all too much of a hardship, you can define your own quote
-adverbs and operators as standard macros.  The main difference is that,
-unlike
-
-quote qs = 'q:s';
-
-declaring something like
-
-macro qs { 'q:s' }
-
-does Inot disable the subsequent search for a parenthesized argument
-to C:n.  To get the equivalent, you need to add a space:
-
-macro qs { 'q:s ' }
+macro qx { 'qq:x ' }  # equivalent to P5's qx//
+macro qTO { 'qq:x:w:to ' }# qq:x:w:to//
+macro circumfix:❰ ❱ ($expr) { q:code{ $expr.quoteharder } }
 
 All the uppercase adverbs are reserved for user-defined quotes.
 All Unicode delimiters above Latin-1 are reserved for user-defined quotes.


[svn:perl6-synopsis] r13586 - doc/trunk/design/syn

2007-02-13 Thread larry
Author: larry
Date: Tue Feb 13 23:22:05 2007
New Revision: 13586

Modified:
   doc/trunk/design/syn/S02.pod

Log:
typos
changed :to be the short form for :heredoc


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podTue Feb 13 23:22:05 2007
@@ -1952,20 +1952,20 @@
 :f  :function   Interpolate  calls
 :c  :closureInterpolate {...} expressions
 :b  :backslash  Interpolate \n, \t, etc. (implies :q at least)
-:to Parse result as heredoc terminator
+:to :heredocParse result as heredoc terminator
 :regex  Parse as regex
 :subst  Parse as substitution
 :trans  Parse as transliteration
 :code   Quasiquoting
 
-You may omit the first colon by joining an initial 'Q', 'q', or 'qq' with
+You may omit the first colon by joining an initial CQ, Cq, or Cqq with
 a single short form adverb, which produces forms like:
 
 qw /a b c/; # P5-esque qw// meaning q:w
 Qc '...{$x}...';# Q:c//, interpolate only closures
 qqx/$cmd @args/ # equivalent to P5's qx//
 
-(Note that Cqx// doesn't intepolate.)
+(Note that Cqx// doesn't interpolate.)
 
 If you want to abbreviate further, just define a macro:
 


[svn:perl6-synopsis] r13587 - doc/trunk/design/syn

2007-02-15 Thread larry
Author: larry
Date: Thu Feb 15 13:04:59 2007
New Revision: 13587

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S12.pod

Log:
Split statement_modifier category in two.
List comprehensions can now be done with statement modifiers.
Multiple dispatch now explained in terms of topological sort.
Multiple dispatch with single semicolons clarified, maybe.  However, multis 
  with single semicolon are likely just a reserved syntax in 6.0.0.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Feb 15 13:04:59 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 13 Feb 2007
+  Last Modified: 15 Feb 2007
   Number: 2
-  Version: 87
+  Version: 88
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -2768,7 +2768,8 @@
 scope_declarator:has  has $.x;
 statement_prefix:gather   gather for @foo { .take }
 statement_control:if  if $condition {...} else {...}
-statement_modifier:if ... if $condition
+statement_mod_cond:if ... if $condition
+statement_mod_loop:for... for 1..10
 infix_prefix_meta_operator:!  $x !~~ 2;
 infix_postfix_meta_operator:= $x += 2;
 postfix_prefix_meta_operator:{'»'}  @array »++

Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podThu Feb 15 13:04:59 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 11 Feb 2007
+  Last Modified: 15 Feb 2007
   Number: 4
-  Version: 52
+  Version: 53
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -188,16 +188,29 @@
 ...
 }
 
-Conditional statement modifiers work as in Perl 5.  So do the
-implicit conditionals implied by short-circuit operators.
-
 If the final statement is a conditional which does not execute any
 branch, the return value is Cundef in item context and C() in
 list context.
 
+Conditional statement modifiers work as in Perl 5.  So do the
+implicit conditionals implied by short-circuit operators.  Note though that
+the first expression within parens or brackets is parsed as a statement,
+so you can say:
+
+@x = 41, (42 if $answer), 43;
+
+and that is equivalent to:
+
+@x = 41, ($answer ?? 42 !! ()), 43
+
 =head1 Loop statements
 
-Looping statement modifiers are the same as in Perl 5.
+Looping statement modifiers are the same as in Perl 5 except that,
+for ease of writing list comprehensions, a looping statement modifier
+is allowed to contain a single conditional statement modifier:
+
+@evens = ($_ * 2 if .odd for 0..100);
+
 Loop modifiers Cnext, Clast, and Credo also work as in Perl 5.
 
 There is no longer a Ccontinue block.  Instead, use a CNEXT block

Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podThu Feb 15 13:04:59 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 9 Feb 2007
+  Last Modified: 15 Feb 2007
   Number: 12
-  Version: 40
+  Version: 41
 
 =head1 Overview
 
@@ -788,6 +788,19 @@
 a final tie-breaking proto sub is called, if there is one (see above).
 Otherwise an exception is thrown.
 
+The order in which candidates are considered is defined by a
+topological sort based on the type narrowness of each candidate's
+long name, where that in turn depends on the narrowness of each
+parameter that is participating.  Identical types are considered tied.
+Parameters whose types are not comparable are also considered tied.
+A candidate is considered narrower than another candidate if at least
+one of its parameters is narrower and all the rest of its parameters
+are either narrower or tied.  This defines the partial ordering of
+all the candidates.  If the topological sort detects a circularity in
+the partial ordering, all candidates in the circle are considered tied.
+A warning will be issued at CCHECK time if this is detected and there is
+no default candidate to fall back to.
+
 Ordinarily all the parameters of a multi sub are considered for dispatch.
 Here's a declaration for an integer range operator with two parameters
 in its long name:
@@ -807,17 +820,27 @@
 Note that a call to the routine must still be compatible with
 subsequent arguments.
 
-However, a given multi may advertise multiple long names

[svn:perl6-synopsis] r13588 - doc/trunk/design/syn

2007-02-16 Thread larry
Author: larry
Date: Fri Feb 16 17:59:34 2007
New Revision: 13588

Modified:
   doc/trunk/design/syn/S13.pod

Log:
Clarification of coercion declarations and semantics.


Modified: doc/trunk/design/syn/S13.pod
==
--- doc/trunk/design/syn/S13.pod(original)
+++ doc/trunk/design/syn/S13.podFri Feb 16 17:59:34 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 2 Nov 2004
-  Last Modified: 17 Jan 2007
+  Last Modified: 16 Feb 2007
   Number: 13
-  Version: 6
+  Version: 7
 
 =head1 Overview
 
@@ -143,15 +143,39 @@
 
 =head1 Type Casting
 
-A class can use the C *infix:as  submethod to declare that its objects
-can be cast to some other class:
+A class may define methods that allow it to respond as if it were a
+routine, array, or hash.  The long forms are as follows:
 
-multi submethod *infix:as (IO)  { $*OUT }
-multi submethod *infix:as (Int) { 1 }
-multi submethod *infix:as (Str) { Hello }
+method postcircumfix:( ) (|$capture) {...}
+method postcircumfix:[ ] (|$capture) {...}
+method postcircumfix:{ } (|$capture) {...}
 
-With the above declaration, C$obj as foo is equivalent to C$obj as Str,
-because the multi dispatch cares only about the class.
+Those are a bit unwieldy, so you may also use these short forms:
+
+method .( |$capture ) {...}
+method @.[ *@@slices ] {...}
+method %.{ *@@slices } {...}
+
+The actual sigil used doesn't matter as long as it's followed by a dot
+and the bracket pair containing the signature.  (Note that the angle
+bracket subscripting form C .a b c  automatically translates
+itself into a call to C .{'a','b','c'} , so defining methods for
+angles is basically useless.)
+
+The expected semantics of C.() is that of a type coercion which may
+or may not create a new object.  So if you say:
+
+$fido = Dog.new($spot)
+
+it certainly creates a new CDog object.  But if you say:
+
+$fido = Dog($spot)
+
+it might call CDog.new, or it might pull a CDog with Spot's
+identity from the dog cache, or it might do absolutely nothing if
+C$spot already knows how to be a CDog.  As a fallback, if no
+method responds to C.(), the class will be asked to attempt to
+do CDog.new($spot) instead.
 
 =cut
 


[svn:perl6-synopsis] r13589 - doc/trunk/design/syn

2007-02-16 Thread larry
Author: larry
Date: Fri Feb 16 18:29:45 2007
New Revision: 13589

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Clarification on what may be returned from, requested by rhr++


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podFri Feb 16 18:29:45 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 12 Feb 2007
+  Last Modified: 16 Feb 2007
   Number: 6
-  Version: 70
+  Version: 71
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -1732,15 +1732,23 @@
 =head2 The Cleave function
 
 As mentioned above, a Creturn call causes the innermost surrounding
-subroutine, method, rule, token, regex (as a keyword) or macro to
-return.  Only declarations with an explicit keyword such as sub
-may be returned from.  You may not use Creturn to return from loops,
-bare blocks, pointy blocks, or quotelike operators such as Crx//.
-
-To return from these types of code structures, the Cleave method
-is used instead.  (It can be taken to mean either go away from or
-bequeath to your successor as appropriate.)
-The object specifies the scope to exit,
+subroutine, method, rule, token, regex (as a keyword) or macro
+to return.  Only declarations with an explicit declarator keyword
+(Csub, Csubmethod, Cmethod, Cmacro, Cregex, Ctoken, and
+Crule) may be returned from.  Statement prefixes such a Cdo and
+Ctry do not fall into that category.  You may not use Creturn to
+return from loops, bare blocks, pointy blocks, or quotelike operators
+such as Crx//; a Creturn within one of those constructs will
+continue searching outward for a proper routine to return from.
+Nor may you return from property blocks such as CBEGIN or CCATCH
+(though blocks executing within the lexical and dynamic scope of a
+routine can of course return from that outer routine, which means
+you can always return from a CCATCH or a CFIRST, but never from
+a CBEGIN or CINIT.)
+
+To return from blocks that aren't routines, the Cleave method is used
+instead.  (It can be taken to mean either go away from or bequeath
+to your successor as appropriate.)  The object specifies the scope to exit,
 and the method's arguments specify the return value.  If the object
 is omitted (by use of the function or listop forms), the innermost
 block is exited.  Otherwise you must use something like Ccaller


[svn:perl6-synopsis] r13590 - doc/trunk/design/syn

2007-02-17 Thread larry
Author: larry
Date: Sat Feb 17 10:25:36 2007
New Revision: 13590

Modified:
   doc/trunk/design/syn/S13.pod

Log:
inconsistency spotted by Smylers++


Modified: doc/trunk/design/syn/S13.pod
==
--- doc/trunk/design/syn/S13.pod(original)
+++ doc/trunk/design/syn/S13.podSat Feb 17 10:25:36 2007
@@ -12,7 +12,7 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 2 Nov 2004
-  Last Modified: 16 Feb 2007
+  Last Modified: 17 Feb 2007
   Number: 13
   Version: 7
 
@@ -147,8 +147,8 @@
 routine, array, or hash.  The long forms are as follows:
 
 method postcircumfix:( ) (|$capture) {...}
-method postcircumfix:[ ] (|$capture) {...}
-method postcircumfix:{ } (|$capture) {...}
+method postcircumfix:[ ] (*@@slices) {...}
+method postcircumfix:{ } (*@@slices) {...}
 
 Those are a bit unwieldy, so you may also use these short forms:
 


[svn:perl6-synopsis] r13591 - doc/trunk/design/syn

2007-02-19 Thread larry
Author: larry
Date: Mon Feb 19 21:53:46 2007
New Revision: 13591

Modified:
   doc/trunk/design/syn/S05.pod

Log:
wrong quantifier on ident noted by putter++


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podMon Feb 19 21:53:46 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 8 Feb 2007
+   Last Modified: 19 Feb 2007
Number: 5
-   Version: 51
+   Version: 52
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -1379,12 +1379,12 @@
 
 A token declaration:
 
-token ident { [ alpha | _ ] \w+ }
+token ident { [ alpha | _ ] \w* }
 
 never backtracks by default.  That is, it likes to commit to whatever
 it has scanned so far.  The above is equivalent to
 
-regex ident { [ alpha: | _: ]: \w+: }
+regex ident { [ alpha: | _: ]: \w*: }
 
 but rather easier to read.  The bare C*, C+, and C? quantifiers
 never backtrack in a Ctoken unless some outer regex has specified a


[svn:perl6-synopsis] r13592 - doc/trunk/design/syn

2007-02-20 Thread larry
Author: larry
Date: Tue Feb 20 09:35:53 2007
New Revision: 13592

Modified:
   doc/trunk/design/syn/S12.pod

Log:
Conjecturalized the delegation-via-hash syntax for now.


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podTue Feb 20 09:35:53 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 15 Feb 2007
+  Last Modified: 20 Feb 2007
   Number: 12
-  Version: 41
+  Version: 42
 
 =head1 Overview
 
@@ -1325,7 +1325,7 @@
 not the declared type.
 
 Any other kind of argument to Chandles is considered to be a
-smartmatch selector for methods.  So you can say:
+smartmatch selector for method names.  So you can say:
 
 has $.fur is rw handles /^get_/;
 
@@ -1334,7 +1334,9 @@
 has $.fur is rw handles Groomable;
 
 then you get only those methods available via the CGroomable role
-or class.
+or class.  To delegate everything, use the CWhatever matcher:
+
+has $the_real_me handles *;
 
 Wildcard matches are evaluated only after it has been determined that
 there's no exact match to the method name anywhere.  When you have
@@ -1369,22 +1371,26 @@
 This is not considered a wildcard match unless the handles argument
 forces it to be.
 
-If your delegation object happens to be a hash:
+[Conjectural: the hash syntax is reserved until we figure out the
+semantics we really want, and whether this actually buys us anything
+over normal polymorphism.] If your delegation object happens to be
+a hash:
 
 has %objects handles 'foo';
 
-then the hash provides a mapping from the string value of self
-to the object that should be delegated to:
+then the hash provides a mapping from a set of Selectors specified as Pair
+keys to the object specified as the Pair value that should be delegated to:
 
 has %barkers handles bark =
 (Chihauhau = $yip,
 Beagle = $yap,
Terrier = $arf,
  StBernard = $woof,
+ * = $ruff,
 );
 method prefix:~( return $.breed )
 
-If the string is not found in the hash, a Cnext METHOD is
+If the current object matches no Selector, a Cnext METHOD is
 automatically performed.
 
 =head1 Types and Subtypes


[svn:perl6-synopsis] r13699 - doc/trunk/design/syn

2007-02-21 Thread larry
Author: larry
Date: Wed Feb 21 09:25:37 2007
New Revision: 13699

Modified:
   doc/trunk/design/syn/S03.pod

Log:
¥ is replaced by Z.  XX becomes simply X and old X must now be spelled X~X.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podWed Feb 21 09:25:37 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 8 Feb 2007
+  Last Modified: 21 Feb 2007
   Number: 3
-  Version: 100
+  Version: 101
 
 =head1 Overview
 
@@ -46,7 +46,7 @@
 Item assignment = := ::= = += -= **= xx= .=
 Loose unary true not
 Comma operator  ,
-List infix  ¥ minmax X XX X~X X*X XeqvX
+List infix  Z minmax X X~X X*X XeqvX
 List prefix = : print push say die map substr ... [+] [*] any all
 Loose and   and
 Loose oror xor err
@@ -1069,13 +1069,13 @@
 
 =item *
 
-infix:¥, the zip operator
+infix:Z, the zip operator
 
-1,2 ¥ 3,4   # (1,3),(2,4)
+1,2 Z 3,4   # (1,3),(2,4)
 
 =item *
 
-The minmax operator
+infix:minmax, the minmax operator
 
 $min0, $max0 minmax $min1, $max1# ($min0 min $min1, $max0 max $max1)
 
@@ -1094,30 +1094,19 @@
 
 =item *
 
-List and string cross operators
+infix:X, the cross operator
 
-1,2 XX 3,4  # (1,3), (1,4), (2,3), (2,4)
-1,2 X 3,4   # '13', '14', '23', '24'
+1,2 X 3,4  # (1,3), (1,4), (2,3), (2,4)
 
-In contrast to the zip operator, the CXX operator returns all the
+In contrast to the zip operator, the CX operator returns all the
 permutations of its sublists.  Hence you may say:
 
-a b XX 1 2
+a b X 1 2
 
 and you end up with
 
 ('a', '1'), ('a', '2'), ('b', '1'), ('b', '2')
 
-The CX variant crosses the arrays but concatenates strings:
-
-a b X 1 2
-
-produces
-
-'a1', 'a2', 'b1', 'b2'
-
-The resemblance to Cx and Cxx is not entirely accidental.
-
 =item *
 
 Cross hyperoperators
@@ -1234,14 +1223,14 @@
 precedence on the right sufficiently to govern list infix
 operators:
 
- $: 1,2 ¥ 3,4   # [[1,3],[2,4]]
- @: 1,2 ¥ 3,4   # 1,3,2,4
-@@: 1,2 ¥ 3,4   # [1,3],[2,4]
- %: 1,2 ¥ 3,4   # { 1 = 3, 2 = 4 }
-
- $: 1,2 XX 3,4  # [[1,3],[1,4],[2,3],[2,4]]
- @: 1,2 XX 3,4  # 1,3,1,4,2,3,2,4
-@@: 1,2 XX 3,4  # [1,3],[1,4],[2,3],[2,4]
+ $: 1,2 Z 3,4   # [[1,3],[2,4]]
+ @: 1,2 Z 3,4   # 1,3,2,4
+@@: 1,2 Z 3,4   # [1,3],[2,4]
+ %: 1,2 Z 3,4   # { 1 = 3, 2 = 4 }
+
+ $: 1,2 X 3,4  # [[1,3],[1,4],[2,3],[2,4]]
+ @: 1,2 X 3,4  # 1,3,1,4,2,3,2,4
+@@: 1,2 X 3,4  # [1,3],[1,4],[2,3],[2,4]
 
 These can also influence the result of functions that returns lists of 
captures:
 
@@ -2892,7 +2881,7 @@
 [//]()  # undef
 [=]()   # undef(same for all assignment operators)
 [,]()   # []
-[¥]()   # []
+[Z]()   # []
 
 User-defined operators may define their own identity values, but
 there is no explicit identity property.  The value is implicit in the
@@ -2998,17 +2987,17 @@
 
 produces
 
-['a', 1, 'x'],
-['a', 1, 'y'],
-['a', 2, 'x'],
-['a', 2, 'y'],
-['b', 1, 'x'],
-['b', 1, 'y'],
-['b', 2, 'x'],
-['b', 2, 'y']
+('a', 1, 'x'),
+('a', 1, 'y'),
+('a', 2, 'x'),
+('a', 2, 'y'),
+('b', 1, 'x'),
+('b', 1, 'y'),
+('b', 2, 'x'),
+('b', 2, 'y')
 
-The string and list forms are common enough to have shortcuts, CX
-and CXX respectively.  See below.
+The list form is common enough to have a shortcut, CX.
+See below.
 
 For the general form, any existing, non-mutating infix operator
 may be used.
@@ -3280,8 +3269,7 @@
 print Name: $name;   Zip code: $zip\n;
 }
 
-Czip has an infix synonym, the Unicode operator C¥, and its ASCII
-equivalent CY.
+Czip has an infix synonym, the CZ operator.
 
 To read arrays in parallel like Czip but just sequence the values
 rather than generating tuples, use Ceach instead of Czip.


[svn:perl6-synopsis] r13700 - doc/trunk/design/syn

2007-02-22 Thread larry
Author: larry
Date: Thu Feb 22 12:51:15 2007
New Revision: 13700

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S06.pod

Log:
More Y XX - Z X clarifications
Now allow constant $?TABSTOP = 4 syntax for user to set compiler variables.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Feb 22 12:51:15 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 15 Feb 2007
+  Last Modified: 22 Feb 2007
   Number: 2
-  Version: 88
+  Version: 89
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1567,12 +1567,25 @@
 in fact be dynamically scoped within the compiler itself, and only
 appear to be lexically scoped because dynamic scopes of the compiler
 resolve to lexical scopes of the program.  All C$? variables are considered
-constants, and may not be modified after being compiled in.
+constants, and may not be modified after being compiled in.  The user
+is also allowed to define or (redefine) such constants:
+
+constant $?TABSTOP = 4; # assume heredoc tabs mean 4 spaces
+
+(Note that the constant declarator always evaluates its initialization
+expression at compile time.)
 
 C$?FILE and C$?LINE are your current file and line number, for
 instance.  C? is not a shortcut for a package name like C* is.
-Instead of C$?OUTER::SUB you probably want to write C OUTER::$?SUB
-.
+Instead of C$?OUTER::SUB you probably want to write C OUTER::$?SUB .
+Within code that is being run during the compile, such as BEGIN blocks,
+or macro bodies, or constant initializers, the compiler variables must
+be referred to as C COMPILING$?LINE  if the bare C$?LINE would
+be taken to be the value during the compilation of the currently running
+code rather than the eventual code of the user's compilation unit.  For
+instance, within a macro body C$?LINE is the line within the macro
+body, but C COMPILING::$?LINE  is the line where the macro was invoked.
+See below for more about the CCOMPILING pseudo package.
 
 Here are some possibilities:
 

Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podThu Feb 22 12:51:15 2007
@@ -1107,6 +1107,13 @@
 
 ('a', '1'), ('a', '2'), ('b', '1'), ('b', '2')
 
+This becomes a flat list in C@ context and a list of arrays in C@@ context:
+
+say @(a b X 1 2)
+'a', '1', 'a', '2', 'b', '1', 'b', '2'
+say @@(a b X 1 2)
+['a', '1'], ['a', '2'], ['b', '1'], ['b', '2']
+
 =item *
 
 Cross hyperoperators

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podThu Feb 22 12:51:15 2007
@@ -1518,7 +1518,7 @@
 right   ** =$a op ($b op $c)**
 non cmp = ..  ILLEGAL cmp
 chain   == eq ~~($a op $b) and ($b op $c)   eqv
-list|  ^ ¥ op($a, $b, $c)  |
+list|  ^ Z op($a; $b; $c)  |
 
 Note that operators Cequiv to relationals are automatically considered
 chaining operators.  When creating a new precedence level, the chaining


[svn:perl6-synopsis] r13701 - doc/trunk/design/syn

2007-02-22 Thread larry
Author: larry
Date: Thu Feb 22 13:06:22 2007
New Revision: 13701

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Change hardwired 8 to $?TABSTOP // 8 for heredocs


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Feb 22 13:06:22 2007
@@ -2475,7 +2475,7 @@
 delimiter will be removed from all preceding lines.  If a line is
 deemed to have less whitespace than the terminator, only whitespace
 is removed, and a warning may be issued.  (Hard tabs will be assumed
-to be 8 spaces, but as long as tabs and spaces are used consistently
+to be C ($?TABSTOP // 8)  spaces, but as long as tabs and spaces are used 
consistently
 that doesn't matter.)  A null terminating delimiter terminates on
 the next line consisting only of whitespace, but such a terminator
 will be assumed to have no indentation.  (That is, it's assumed to


[svn:perl6-synopsis] r13703 - doc/trunk/design/syn

2007-02-22 Thread larry
Author: larry
Date: Thu Feb 22 16:32:25 2007
New Revision: 13703

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Clarify that a named argument may name either the label or the variable name.


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podThu Feb 22 16:32:25 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 16 Feb 2007
+  Last Modified: 22 Feb 2007
   Number: 6
-  Version: 71
+  Version: 72
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -519,6 +519,12 @@
 multi sub handle_event ($window, $event; $mode) {...}
 multi method set_name ($self: $name; $nick) {...}
 
+A double semicolon terminates the longest possible longname; parameters
+after this are never considered for multiple dispatch (except of course
+that they can still veto if their number or types mismatch).  (Note,
+the single semicolon form is still considered conjectural, though the
+double semicolon is fairly certain.)
+
 If the parameter list for a Cmulti contains no semicolon to delimit
 the list of important parameters, then all positional parameters are
 considered important.  If it's a Cmulti method or Cmulti submethod,
@@ -615,6 +621,11 @@
 
 so that you can use more descriptive internal parameter names without
 imposing inconveniently long external labels on named arguments.
+If a named argument does not match any label, it is matched against
+the variable names as a fallback.  This allows you to give both a
+short and a long name:
+
+sub globalize (:g($global)) {...}
 
 Arguments that correspond to named parameters are evaluated in scalar
 context. They can only be passed by name, so it doesn't matter what


[svn:perl6-synopsis] r13705 - doc/trunk/design/syn

2007-02-26 Thread larry
Author: larry
Date: Mon Feb 26 11:42:16 2007
New Revision: 13705

Modified:
   doc/trunk/design/syn/S02.pod

Log:
apostrophe illiteracy...


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon Feb 26 11:42:16 2007
@@ -25,7 +25,7 @@
 
 =head1 One-pass parsing
 
-To the extent allowed by sublanguages parsers, Perl is parsed using a
+To the extent allowed by sublanguages' parsers, Perl is parsed using a
 one-pass, predictive parser.  That is, lookahead of more than one
 longest token is discouraged.  The currently known exceptions to
 this are where the parser must:


[svn:perl6-synopsis] r13706 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry
Date: Tue Feb 27 15:41:10 2007
New Revision: 13706

Modified:
   doc/trunk/design/syn/S09.pod

Log:
Some clarifications requested by Geoffrey Broadwell++.


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podTue Feb 27 15:41:10 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 13 Sep 2004
-  Last Modified: 30 Jan 2007
+  Last Modified: 27 Jan 2007
   Number: 9
-  Version: 16
+  Version: 17
 
 =head1 Overview
 
@@ -50,10 +50,12 @@
 uint32
 uint64
 
+num16
 num32
 num64   (aka num on most architectures)
 num128
 
+complex16
 complex32
 complex64   (aka complex on most architectures)
 complex128
@@ -79,23 +81,70 @@
 associate additional names, such as short or single.  These are
 not provided by default.  An implementation of Perl is not required
 to support 64-bit integer types or 128-bit floating-point types unless
-the underlying architecture supports them.
+the underlying architecture supports them.  16-bit floating-point is
+also considered optional in this sense.
 
 And yes, an Cint1 can store only -1 or 0.  I'm sure someone'll think of
 a use for it...
 
+Note that these are primarily intended to represent storage types;
+the compiler is generally free to keep all intermediate results in
+wider types in the absence of declarations or explicit casts to the
+contrary.  Attempts to store an intermediate result in a location
+that cannot hold it will generally produce a warning on overflow.
+Underflow may also warn depending on the pragmatic context and use
+of explicit rounding operators.  The default rounding mode from
+CNum to CInt is to truncate the fractional part without warning.
+(Note that warnings are by definition resumable exceptions; however,
+an exception handler is free to either transform such a warning into
+a fatal exception or ignore it completely.)
+
+An explicit cast to a storage type has the same potential to throw an
+exception as the actual attempt to store to such a storage location
+would.
+
+With IEEE floating-point types, we have a bias towards the use
+of in-band C+Inf, C-Inf, and CNaN values in preference to
+throwing an exception, since this is construed as friendlier to vector
+processing and pipelining.  Object types such as CNum and CInt
+may store additional information about the nature of the failure,
+perhaps as an unthrown exception or warning.
+
 =head1 Compact structs
 
-A class whose attributes are all low-level types can behave as
+A class whose attributes are all low-level value types can behave as
 a struct.  (Access from outside the class is still only through
-accessors, though.)  Whether such a class is actually stored compactly
-is up to the implementation, but it ought to behave that way,
-at least to the extent that it's trivially easy (from the user's
-perspective) to read and write to the equivalent C structure.
-That is, when byte-stringified, it should look like the C struct,
+accessors, though, except when the address of a serialized version of
+the object is used or generated for interfacing to C-like languages.)
+Whether such a class is actually stored compactly is up to the
+implementation, but it ought to behave that way, at least to the
+extent that it's trivially easy (from the user's perspective) to read
+and write to the equivalent C structure.  That is, when serialized
+or deserialized to the C view, it should look like the C struct,
 even if that's not how it's actually represented inside the class.
 (This is to be construed as a substitute for at least some of the
-current uses of Cpack/Cunpack.)
+current uses of Cpack/Cunpack.)  Of course, a lazy implementation will
+probably find it easiest just to keep the object in its serialized form
+all the time.  In particular, an array of compact structs must be stored
+in their serialized form (see next section).
+
+For types that exist in the C programming language, the serialized
+mapping in memory should follow the same alignment and padding
+rules by default.  Integers smaller than a byte are packed into a
+power-of-two number of bits, so a byte holds four 2-bit integers.
+Datum sizes that are not a power of two bits are not supported
+unless declared by the user with sufficient information to determine
+how to lay them out in memory, possibly with a pack/unpack format
+associated with the class, or with the strange elements of the class,
+or with the types under which the strange element is declared.
+
+Note that a compact struct is itself a value type, so except for
+performance considerations, it doesn't matter how many representations
+of it there are in memory as long as those are consistent.
+
+The packing serialization is performed by coercion to an appropriate
+buffer type.  The unpacking is performed by coercion of such a buffer
+type back

[svn:perl6-synopsis] r13707 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry
Date: Tue Feb 27 15:56:44 2007
New Revision: 13707

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Modifiers on bit shifts.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podTue Feb 27 15:56:44 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 21 Feb 2007
+  Last Modified: 27 Feb 2007
   Number: 3
-  Version: 101
+  Version: 102
 
 =head1 Overview
 
@@ -540,6 +540,9 @@
 
 +
 
+By default, signed types do sign extension, while unsigned types do not, but
+this may be enabled or disabled with a C:signed or C:!signed adverb.
+
 =item *
 
 infix:~, string bitwise and
@@ -548,16 +551,19 @@
 
 =item *
 
-infix:{'~'}, string bitwise shift left
+infix:{'~'}, buffer bitwise shift left
 
 ~
 
 =item *
 
-infix:{'~'}, string bitwise shift right
+infix:{'~'}, buffer bitwise shift right
 
 ~
 
+Sign extension is not done by default but may be enabled with a C:signed
+adverb.
+
 =item *
 
 infix:?, boolean bitwise and
@@ -566,6 +572,10 @@
 
 =back
 
+Any bit shift operator may be turned into a rotate operator with the
+C:rotate adverb.  If C:rotate is specified, the default is
+unsigned, and you may not explicitly specify a C:signed adverb.
+
 =head2 Additive precedence
 
 =over


[svn:perl6-synopsis] r13708 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry
Date: Tue Feb 27 17:00:09 2007
New Revision: 13708

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Better writing requested by John Macdonald++


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podTue Feb 27 17:00:09 2007
@@ -573,8 +573,8 @@
 =back
 
 Any bit shift operator may be turned into a rotate operator with the
-C:rotate adverb.  If C:rotate is specified, the default is
-unsigned, and you may not explicitly specify a C:signed adverb.
+C:rotate adverb.  If C:rotate is specified, the concept of
+sign extenstion is meaningless, and you may not specify a C:signed adverb.
 
 =head2 Additive precedence
 


[svn:perl6-synopsis] r13709 - doc/trunk/design/syn

2007-02-27 Thread larry
Author: larry
Date: Tue Feb 27 17:01:23 2007
New Revision: 13709

Modified:
   doc/trunk/design/syn/S03.pod

Log:
gah


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podTue Feb 27 17:01:23 2007
@@ -574,7 +574,7 @@
 
 Any bit shift operator may be turned into a rotate operator with the
 C:rotate adverb.  If C:rotate is specified, the concept of
-sign extenstion is meaningless, and you may not specify a C:signed adverb.
+sign extension is meaningless, and you may not specify a C:signed adverb.
 
 =head2 Additive precedence
 


[svn:perl6-synopsis] r14306 - doc/trunk/design/syn

2007-02-28 Thread larry
Author: larry
Date: Wed Feb 28 07:55:51 2007
New Revision: 14306

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S05.pod
   doc/trunk/design/syn/S06.pod

Log:
The old is context is rw is now written is contextrw.
The old is context(Scalar) is gone; use a macro.
Fixed some off-by-one errors in the S05 ascii art.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed Feb 28 07:55:51 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 26 Feb 2007
+  Last Modified: 28 Feb 2007
   Number: 2
-  Version: 90
+  Version: 91
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1503,11 +1503,12 @@
 failure.
 
 Any lexical declared with the Cis context trait is by default
-considered readonly outside the current lexical scope.  You may add
-Cis rw to allow called routines to modify your value.  C$_,
-C$!, and C$/ are Crw by default.  In any event, your lexical
-scope can always access the variable as if it were an ordinary Cmy;
-the restriction on writing applies only to called subroutines.
+considered readonly outside the current lexical scope.  You may
+add a trait argument of C rw  to allow called routines to
+modify your value.  C$_, C$!, and C$/ are C contextrw 
+by default.  In any event, your lexical scope can always access the
+variable as if it were an ordinary Cmy; the restriction on writing
+applies only to called subroutines.
 
 =item *
 

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podWed Feb 28 07:55:51 2007
@@ -1965,7 +1965,7 @@
 # |   subpattern  subpattern  |
 # |  __/\____/\__ |
 # | |  |  |  ||
- ms/ (I am the (walrus), ( khoo )**{2} kachoo) /;
+  ms/ (I am the (walrus), ( khoo )**{2} kachoo) /;
 
 
 =item *
@@ -1996,7 +1996,7 @@
 # | subpat-B  subpat-C|
 # |  __/\____/\__ |
 # | |  |  |  ||
- ms/ (I am the (walrus), ( khoo )**{2} kachoo) /;
+  ms/ (I am the (walrus), ( khoo )**{2} kachoo) /;
 
 then the CMatch objects representing the matches made by Isubpat-B
 and Isubpat-C would be successively pushed onto the array inside Isubpat-
@@ -2062,7 +2062,7 @@
 
 =item *
 
-This behavior is quite different to Perl 5 semantics:
+This behavior is quite different from Perl 5 semantics:
 
   # Perl 5...
   #
@@ -,7 +,7 @@
 =item *
 
 In particular, the index of capturing parentheses restarts after each
-C|. Hence:
+C| or C|| (but not after each C or C). Hence:
 
   # $0  $1$2   $3$4   $5
  $tune_up = rx/ (don't) (ray) (me) (for) (solar tea), (d'oh!)
@@ -2282,7 +2282,7 @@
   # : $/ident   :$/[0]ident : :
   # :   __^__ :   __^__ : :
   # :  | |:  | |: :
- ms/  ident \: ( known as ident previously ) /
+  ms/  ident \: ( known as ident previously ) /
 
 
 =back
@@ -2301,7 +2301,7 @@
   #$ident $0ident
   # __^__ __^__
   #| |   | |
- ms/  ident \: ( known as ident previously ) /
+  ms/  ident \: ( known as ident previously ) /
 
 =item *
 
@@ -2409,10 +2409,10 @@
 
 If a named scalar alias is applied to a set of Icapturing parens:
 
-#  __/capturing parens\_
-# | |
-# | |
- ms/ $key:=( ([A..E]) (\d**{3..6}) (X?) ) /;
+#  __/capturing parens\__
+# |  |
+# |  |
+  ms/ $key:=( ([A..E]) (\d**{3..6}) (X?) ) /;
 
 then the outer capturing parens no longer capture into the array of
 C$/ as unaliased parens would. Instead the aliased parens capture
@@ -2467,10 +2467,10 @@
 
 If a named scalar alias is applied to a set of Inon-capturing brackets:
 
-#  ___/non-capturing brackets\__
-# | |
-# | |
- ms/ $key:=[ ([A..E]) (\d**{3..6}) (X?) ] /;
+#  ___/non-capturing brackets\___
+# |  |
+# |  |
+  ms/ $key:=[ ([A..E]) (\d**{3..6}) (X?) ] /;
 
 then the corresponding C $/key  Match object contains only the string
 matched by the non-capturing brackets.
@@ -2580,28 +2580,28

[svn:perl6-synopsis] r14307 - doc/trunk/design/syn

2007-02-28 Thread larry
Author: larry
Date: Wed Feb 28 09:54:41 2007
New Revision: 14307

Modified:
   doc/trunk/design/syn/S05.pod

Log:
Deleted obsolete symbol construct


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podWed Feb 28 09:54:41 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 19 Feb 2007
+   Last Modified: 28 Feb 2007
Number: 5
-   Version: 52
+   Version: 53
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -395,23 +395,6 @@
 m/:foo{xxx}/Parses as :foo {xxx}
 m/:fooxxx/Parses as :foo xxx
 
-If the key of the pair is null, however, it is treated as a symbol
-declaration:
-
-:*Match * symbol
-:[ EXPR :]Match bracketed expression as symbol :[ ]
-:['','']  Match empty  as circumfix symbol
-:(infix)   Match any symbol matched by the infix category
-
-The components of a symbol declaration are matched literally, but
-the list of such symbols is gathered up when the rule is parsed and
-returned as the C.symbol property of the rule.  (The C.category
-property should also be available for such rules, since these
-properties are used to form the eventual user-visible name of the
-operator being parsed.)
-
-The C:() form is conjectured to be useful in generating hyperoperators.
-
 =item *
 
 User-defined modifiers will be possible:


[svn:perl6-synopsis] r14308 - doc/trunk/design/syn

2007-02-28 Thread larry
Author: larry
Date: Wed Feb 28 13:21:47 2007
New Revision: 14308

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Distinguish Range's intervalic .min and .max from its directed .from and .to.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podWed Feb 28 13:21:47 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 27 Feb 2007
+  Last Modified: 28 Feb 2007
   Number: 3
-  Version: 102
+  Version: 103
 
 =head1 Overview
 
@@ -1993,19 +1993,26 @@
 
 =item *
 
-The C.. range operator has variants with C^ on either
-end to indicate exclusion of that endpoint from the range.  It always
-produces a CRange object.  Range objects are lazy iterators, and can
-be interrogated for their current C.min and C.max values (which
-change as they are iterated).  The C.minmax method returns both as
-a two-element list.  Ranges are not autoreversing: C2..1
-is always a null range, as is C1^..^2.  To reverse a range use:
+The C.. range operator has variants with C^ on either end to
+indicate exclusion of that endpoint from the range.  It always
+produces a CRange object.  Range objects are lazy iterators, and
+can be interrogated for their current C.from and C.to values
+(which change as they are iterated).  The C.minmax method returns
+both as a two-element list representing the interval.  Ranges are not
+autoreversing: C2..1 is always a null range.  Likewise, C1^..^2
+produces no values when iterated, but does represent the interval from
+1 to 2 excluding the endpoints when used as a pattern.  To iterate
+a range in reverse use:
 
 2..1:by(-1)
 reverse 1..2
 
 (The Creverse is preferred because it works for alphabetic ranges
-as well.)
+as well.)  Note that, while C.minmax normally returns C(.from,.to),
+a negative C:by causes the C.minmax method returns C(.to,.from)
+instead.  You may also use C.min and C.max to produce the individual
+values of the C.minmax pair, but again note that they are reversed
+from C.from and C.to when the step is negative.
 
 Because CRange objects are lazy, they do not automatically generate
 a list.  So smart matching against a CRange object smartmatches the
@@ -2015,13 +2022,13 @@
 1.5 ~~ 1^..^2  # true, equivalent to 1  1.5  2
 2.1 ~~ 1..2# false, equivalent to 1 = 2.1 = 2
 
-If a C* (see the Whatever type in S02) occurs on
-the right side of a range, it is taken to mean positive infinity
-in whatever space the range is operating.  A C* on the left means
-negative infinity for types that support negative values.  If the
-C* occurs on one side but not the other, the type is inferred from
-the other argument.  A star on both sides will match any value that
-supports the COrdered role.
+If a C* (see the Whatever type in S02) occurs on the right side
+of a range, it is taken to mean positive infinity in whatever space
+the range is operating.  A C* on the left means negative infinity
+for types that support negative values. (The sign of those infinites
+reverses for a negative step.)  If the C* occurs on one side but
+not the other, the type is inferred from the other argument.  A star
+on both sides will match any value that supports the COrdered role.
 
 0..*# 0 .. +Inf
 'a'..*  # 'a' .. 'z...'
@@ -2032,6 +2039,22 @@
 Note: infinite lists are constructed lazily.  And even though C*..*
 can't be constructed at all, it's still useful as a selector object.
 
+Range objects may be iterated on either end as long as it is not
+infinite.  (Iterating an infinite end does not fail but just produces a
+lot of infinities.)  Ordinary iteration iterates the C.from value by
+adding the step.  Either C prefix:=  or the Cshift function
+may be used to iterate the front of a range object.  The Cpop
+function iterates the C.to end by subtracting the step.  In either
+case, the value returned is either the old value if the endpoint
+was inclusive, or the next value if the endpoint was exclusive.
+In the case of ranges that are not an integral multiple of the step,
+no check is done to see that iterating the front would produce the
+same list as interating from the back and reversing.  So we have
+
+$range = 1..^42.5;
+$front = $range.shift;  # $front = 1, $range = 2..^42.5
+$back = $range.pop;  # $back = 41.5, $range = 2..^41.5
+
 For any kind of zip or dwimmy hyper operator, any list ending with C*
 is assumed to be infinitely extensible by taking its final element
 and replicating it:


[svn:perl6-synopsis] r14311 - doc/trunk/design/syn

2007-03-05 Thread larry
Author: larry
Date: Mon Mar  5 19:01:16 2007
New Revision: 14311

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S06.pod

Log:
the change back from .give to .leave was incomplete as noted by rhr++.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon Mar  5 19:01:16 2007
@@ -2469,7 +2469,7 @@
 
 would work just as well.  You can exit any labeled block early by saying
 
-MyLabel.give(@results);
+MyLabel.leave(@results);
 
 =item *
 

Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podMon Mar  5 19:01:16 2007
@@ -2025,7 +2025,7 @@
 If a C* (see the Whatever type in S02) occurs on the right side
 of a range, it is taken to mean positive infinity in whatever space
 the range is operating.  A C* on the left means negative infinity
-for types that support negative values. (The sign of those infinites
+for types that support negative values. (The sign of those infinities
 reverses for a negative step.)  If the C* occurs on one side but
 not the other, the type is inferred from the other argument.  A star
 on both sides will match any value that supports the COrdered role.

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podMon Mar  5 19:01:16 2007
@@ -1629,7 +1629,7 @@
 blocks this can be optimized away to a goto.  All CRoutine declarations
 have an explicit declarator such as Csub or Cmethod; bare blocks and
 pointy blocks are never considered to be routines in that sense.  To return
-from a block, use Cgive instead--see below.
+from a block, use Cleave instead--see below.
 
 The Creturn function preserves its argument list as a CCapture object, and
 responds to the left-hand CSignature in a binding.  This allows named return
@@ -1775,10 +1775,10 @@
 COUNT.leave;
 last COUNT;
 
-However, the first form explicitly gives the return value for the
+However, the first form explicitly sets the return value for the
 entire loop, while the second implicitly returns all the previous
 successful loop iteration values as a list comprehension.  (It may,
-in fact, be too late to give a return value for the loop if it is
+in fact, be too late to set a return value for the loop if it is
 being evaluated lazily!)  A Cleave
 from the inner loop block, however, merely specifies the return value for
 that iteration:


[svn:perl6-synopsis] r14312 - doc/trunk/design/syn

2007-03-06 Thread larry
Author: larry
Date: Tue Mar  6 21:34:30 2007
New Revision: 14312

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Some clarifications and oversights noted by TheDamian++.
The foo\($bar) shorthand for foo.assuming($bar) is now gone.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podTue Mar  6 21:34:30 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 28 Feb 2007
+  Last Modified: 6 Feb 2007
   Number: 2
-  Version: 91
+  Version: 92
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1238,11 +1238,7 @@
 foo:(Int,Num)
 
 It still just returns a CCode object.  A call may also be partially
-applied by using an argument list literal as a postfix operator:
-
-foo\(1,2,3,:miceblind)
-
-This is really just a shorthand for
+applied by using the C.assuming method:
 
 foo.assuming(1,2,3,:miceblind)
 
@@ -1573,6 +1569,8 @@
 
 Standard input is C$*IN, standard output is C$*OUT, and standard error
 is C$*ERR.  The magic command-line input handle is C$*ARGS.
+The arguments themselves come in C@*ARGS.  See also Declaring a MAIN
+subroutine in S06.
 
 =item *
 
@@ -1907,7 +1905,7 @@
 a = %a :%a
 a = $$a:$$a
 a = @$$a   :@$$a (etc.)
-a = %fooa%foo:a
+a = %fooa%fooa:p
 
 Note that as usual the C{...} form can indicate either a closure or a hash
 depending on the contents.  It does Inot indicate a subscript.
@@ -2450,8 +2448,8 @@
 or as an array via C@=DATA.  Presumably a module could read all
 its COMMENT blocks from C@=COMMENT, for instance.  Each chunk of
 pod comes as a separate array element.  You have to split it into lines
-yourself.  Each chunk has a C.linenum property that indicates its
-starting line within the source file.
+yourself.  Each chunk has a C.range property that indicates its
+line number range within the source file.
 
 The lexical routine itself is C?ROUTINE; you can get its name with
 CROUTINE.name.  The current block is C?BLOCK.  If the block has a label,


[svn:perl6-synopsis] r14313 - doc/trunk/design/syn

2007-03-06 Thread larry
Author: larry
Date: Tue Mar  6 21:54:01 2007
New Revision: 14313

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Q: Can February March?  A: No, but April May...


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podTue Mar  6 21:54:01 2007
@@ -12,7 +12,7 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 6 Feb 2007
+  Last Modified: 6 Mar 2007
   Number: 2
   Version: 92
 


[svn:perl6-synopsis] r14315 - doc/trunk/design/syn

2007-03-07 Thread larry
Author: larry
Date: Wed Mar  7 16:18:15 2007
New Revision: 14315

Modified:
   doc/trunk/design/syn/S03.pod

Log:
made my Any $x; $x := [1,2,3] a little dwammy (do what audreyt++ means :)


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podWed Mar  7 16:18:15 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 28 Feb 2007
+  Last Modified: 7 Mar 2007
   Number: 3
-  Version: 103
+  Version: 104
 
 =head1 Overview
 
@@ -1001,7 +1001,17 @@
 true in the above example.
 
 The binding fails if the type of the variable being bound is sufficiently
-inconsistent with the type of the current declaration.
+inconsistent with the type of the current declaration.  Strictly speaking,
+any variation on
+
+my Any $x;
+$x := [1,2,3];
+
+should fail because the type being bound is not consistent with
+CScalar of Any, but since the CAny type is not a real instantiable
+type but a generic (non)constraint, and CScalar of Any is sort of
+a double non-constraint similar to CAny, we treat this situation
+specially as the equivalent of binding to a typeless variable.
 
 =item *
 
@@ -1009,7 +1019,9 @@
 
 ::=
 
-This does the same as C:= except it does it at compile time.
+This does the same as C:= except it does it at compile time.  (This implies
+that the expression on the right is also evaluated at compile time; it does
+not bind a lazy thunk.)
 
 =item *
 


[svn:perl6-synopsis] r14316 - doc/trunk/design/syn

2007-03-07 Thread larry
Author: larry
Date: Wed Mar  7 17:25:32 2007
New Revision: 14316

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Clarifications requested by TheDamian++
Defined ++ and -- in terms of .succ and .pred so I could write s[] = $0.succ


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podWed Mar  7 17:25:32 2007
@@ -312,12 +312,40 @@
 
 say $x unless %seen{$x}++;
 
-Increment of a CStr (in a suitable container) works as in Perl 5.
-(Use a derived type or a lexical multi to change this.)  Perl 6 also
-supports CStr decrement.
+Increment of a CStr (in a suitable container) works similarly to
+Perl 5 except that the final alphanumeric sequence in the string is
+incremented regardless of what comes before it.  For its typical use
+of incrementing a filename, you don't have to worry about the path name, but
+you do still have to worry about the extension, so you probably want to say
+
+my $fh = open $filename++ ~ '.jpg';
+
+Alternately, you can increment a submatch:
+
+$filename ~~ s[^.* (\w+) \.\w+$] = $().succ;
+
+Perl 6 also supports CStr decrement.
+
+Increment and decrement are defined in terms of the C.succ and
+C.pred methods on the type of object in the CScalar container.
+More specifically,
+
+++$var
+--$var
+
+are equivalent to
+
+$var.=succ
+$var.=pred
+
+If the type does not support these methods, the corresponding increment
+or decrement operation will fail.  (The optimizer is allowed to assume
+that the ordinary increment and decrement operations on integers will
+not be overridden.)
 
 Increment of a CBool (in a suitable container) turns it true.
-Decrement turns it false.  This is useful if your C%seen array is
+Decrement turns it false regardless of how many times it was
+previously incremented.  This is useful if your C%seen array is
 actually a CKeySet, in which case decrement actually deletes it
 from the CKeySet.
 
@@ -872,9 +900,14 @@
 
 ||
 
-Returns the left argument if it's true, otherwise evaluates and
-returns the right argument.  In list context forces a false return
-to mean C().  See Cor below for low-precedence version.
+Returns the left argument if it's true, otherwise evaluates and returns
+the right argument.  It is specifically allowed to use a list or array
+both as a boolean and as a list value produced if the boolean is true:
+
+@a = @b || @c;  # broken in Perl 5; works in Perl 6
+
+In list context this operator forces a false return to mean C().
+See Cor below for low-precedence version.
 
 =item *
 
@@ -1810,7 +1843,7 @@
 
 =item *
 
-A function predeclared as 0-ary is never considered list
+A function predeclared as 0-ary is never considered a list
 operator, though it allows an optional set of empty parentheses.
 Unlike functions and list operators with arguments (see above),
 a 0-ary function does not require parentheses even if followed
@@ -2024,10 +2057,13 @@
 a negative C:by causes the C.minmax method returns C(.to,.from)
 instead.  You may also use C.min and C.max to produce the individual
 values of the C.minmax pair, but again note that they are reversed
-from C.from and C.to when the step is negative.
+from C.from and C.to when the step is negative.  Since a reversed
+CRange changes its direction, it swaps its C.from and C.to but
+not its C.min and C.max.
 
 Because CRange objects are lazy, they do not automatically generate
-a list.  So smart matching against a CRange object smartmatches the
+a list.  One result of this is that a reversed CRange object is still lazy.
+Another is that smart matching against a CRange object smartmatches the
 endpoints in the domain of the object being matched, so fractional
 numbers are Cnot truncated before comparison to integer ranges:
 
@@ -2208,13 +2244,13 @@
 Hash  Hash  hash keys same set  $_.keys === X.keys
 Set   Hash  hash keys same set  $_ === X.keys
 Array Hash  hash slice existenceX.contains(any @$_)
-Regex Hash  hash key grep   any($_.keys) === /X/
+Regex Hash  hash key grep   any(X.keys).match($_)
 ScalarHash  hash entry existenceX.contains($_)
 Any   Hash  hash slice existenceX.contains(any @$_)
 
 Str   Regex string pattern match.match(X)
-Hash  Regex hash key boolean grep .any.match(/X/)
-Array Regex array boolean grep.any.match(/X/)
+Hash  Regex hash key boolean grep .any.match(X)
+Array Regex array boolean grep.any.match(X)
 Any   Regex pattern match   .match(X)
 
 Num   Range in numeric rangeX.min = $_ = X.max (mod ^'s)


[svn:perl6-synopsis] r14317 - doc/trunk/design/syn

2007-03-07 Thread larry
Author: larry
Date: Wed Mar  7 20:38:15 2007
New Revision: 14317

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S11.pod

Log:
Module longnames now specified in terms of ident plus adverbials.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed Mar  7 20:38:15 2007
@@ -2531,6 +2531,21 @@
 END
 }
 
+=item *
+
+A version literal are written with a 'v' followed by the version
+number in dotted form.  This always constructs a CVersion object, not
+a string.  Only integers are allowed; for anything fancier you must
+coerce a string to a CVersion:
+
+v1.2.3  # okay
+v1.2.3beta  # illegal
+Version('1.2.3beta')# okay
+
+Note though that most places that take a version number in Perl accept
+it as a named argument, in which case saying C :ver1.2.3beta  is fine.
+See S11 for more on using versioned modules.
+
 =back
 
 =head1 Context

Modified: doc/trunk/design/syn/S11.pod
==
--- doc/trunk/design/syn/S11.pod(original)
+++ doc/trunk/design/syn/S11.podWed Mar  7 20:38:15 2007
@@ -202,46 +202,72 @@
 where to keep them, such that multiple versions by different authors
 can coexist, all of them available to any installed version of Perl.
 
-The syntax of a versioned module or class declaration has three parts
-separated by hyphens.  The three parts are the short name of the
-class/module, its version number, and a URI identifying the author
-(or authorizing authority). For example:
-
-class Dog-1.2.1-cpan:JRANDOM;
-class Dog-1.2.1-http://www.some.com/~jrandom;
-class Dog-1.2.1-mailto:[EMAIL PROTECTED];
-
-Such a declaration automatically aliases the full name
-of the class (or module) to the short name.  So for the rest of the
-lexical scope, CDog refers to the longer name.
+The syntax of a versioned module or class declaration has multiple
+parts in which the non-identifier parts are specified in adverbial pair
+notation without intervening spaces.  Internally these are stored in
+a canonical string form which you should ignore.  You may write the
+various parts in any order, except that the bare identifer must come
+first.  The required parts for library insertion are the short name of
+the class/module, its version number, and a URI identifying the author
+(or authorizing authority, so we call it auth to be intentionally ambiguous).
+For example:
+
+class Dog:ver1.2.1:authcpan:JRANDOM;
+class Dog:ver1.2.1:authhttp://www.some.com/~jrandom;
+class Dog:ver1.2.1:authmailto:[EMAIL PROTECTED];
+
+Since these are somewhat unweildy to look at, we allow a shorthand in 
+which a bare subscripty adverb interprets its elements according to their
+form:
+
+class Dog:1.2.1 cpan:JRANDOM
+
+These declarations automatically alias the full name of the class
+(or module) to the short name.  So for the rest of the lexical scope,
+CDog refers to the longer name.  The real library name can be
+specified separately as another adverb, in which case the identifier
+indicates only the alias within the current lexical scope:
+
+class Pooch:nameDog:ver1.2.1:authcpan:JRANDOM
+
+or 
+
+class Pooch:Dog 1.2.1 cpan:JRANDOM
+
+for short.
+
+Here the real name of the module starts CDog, but we refer to it
+as CPooch for the rest of this file.  Aliasing is handy if you need to
+interface to more than one module named CDog
 
 If there are extra classes or modules or packages declared within
 the same file, they implicitly have a long name including the file's
 version and author, but you needn't declare them again.
 
-Since these long names are the actual names of the classes, when you say:
+Since these long names are the actual names of the classes as far as
+the library system is concerned, when you say:
 
 use Dog;
 
 you're really wildcarding the unspecified bits:
 
-use Dog-(Any)-(Any);
+use Dog:ver(Any):auth(Any);
 
 And when you say:
 
-use Dog-1.2.1;
+use Dog:1.2.1;
 
 you're really asking for:
 
-use Dog-1.2.1-(Any);
+use Dog:ver1.2.1:auth(Any);
 
 Saying C1.2.1 specifies an Iexact match on the version number,
 not a minimum match.  To match more than one version, put a range
 operator in parens:
 
-use Dog-(1.2.1..1.2.3);
-use Dog-(1.2.1..^1.3);
-use Dog-(1.2.1..*);
+use Dog:ver(1.2.1..1.2.3);
+use Dog:ver(1.2.1..^1.3);
+use Dog:ver(1.2.1..*);
 
 Subversions are wildcarded, so C1.2 really means C1.2.*.  If you
 say:
@@ -250,45 +276,45 @@
 
 which is short for:
 
-use Perl-6;
+use Perl:ver6;
 
-you're asking for any version of Perl 6.  You need to say:
+you're asking for any version of Perl 6.  You need to say something like
 
-use Perl-6.0;
-use Perl-6.0.0;
-use Perl-6.2.7.1;
+use Perl:6.0

[svn:perl6-synopsis] r14318 - doc/trunk/design/syn

2007-03-07 Thread larry
Author: larry
Date: Wed Mar  7 20:40:33 2007
New Revision: 14318

Modified:
   doc/trunk/design/syn/S02.pod

Log:
typo spotted by TimToady++   :/


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed Mar  7 20:40:33 2007
@@ -2533,7 +2533,7 @@
 
 =item *
 
-A version literal are written with a 'v' followed by the version
+A version literal is written with a 'v' followed by the version
 number in dotted form.  This always constructs a CVersion object, not
 a string.  Only integers are allowed; for anything fancier you must
 coerce a string to a CVersion:


[svn:perl6-synopsis] r14319 - doc/trunk/design/syn

2007-03-07 Thread larry
Author: larry
Date: Wed Mar  7 21:35:52 2007
New Revision: 14319

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Definition of version sorting order.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed Mar  7 21:35:52 2007
@@ -2546,6 +2546,44 @@
 it as a named argument, in which case saying C :ver1.2.3beta  is fine.
 See S11 for more on using versioned modules.
 
+Version objects have a predefined sort order that follows most people's
+intuition about versioning: each sorting position sorts numerically
+between numbers, alphabetically between alphas, and alphabetics in a
+position before numerics.  Numbers ignore leading zeros. For splitting
+into sort positions, if any alphabetics (including underscore) are
+immediately adjacent to a number, a dot is assumed between them,
+so these are all equivalent:
+
+1.2.1alpha1
+1.2.1.alpha1
+1.2.1alpha.1
+1.2.1.alpha.1
+
+And these are also equivalent:
+
+1.2.1_01
+1.2.1_1
+1.2.1._1
+1.2.1_1
+1.2.1._.1
+001.0002.01._.001
+
+So these are in sorted version order:
+
+1.2.0.999
+1.2.1_01
+1.2.1_2
+1.2.1_003
+1.2.1a1
+1.2.1.alpha1
+1.2.1b1
+1.2.1.beta1
+1.2.1.gamma
+1.2.1α1
+1.2.1β1
+1.2.1γ
+1.2.1
+
 =back
 
 =head1 Context


[svn:perl6-synopsis] r14320 - doc/trunk/design/syn

2007-03-08 Thread larry
Author: larry
Date: Thu Mar  8 10:32:50 2007
New Revision: 14320

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S11.pod

Log:
Further clarification of version syntax as requested by geoff++ and others.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Mar  8 10:32:50 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 6 Mar 2007
+  Last Modified: 8 Mar 2007
   Number: 2
-  Version: 92
+  Version: 93
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -2549,15 +2549,19 @@
 Version objects have a predefined sort order that follows most people's
 intuition about versioning: each sorting position sorts numerically
 between numbers, alphabetically between alphas, and alphabetics in a
-position before numerics.  Numbers ignore leading zeros. For splitting
+position before numerics.  Missing final positions are assumed to be '.0'.
+Except for '0' itself, numbers ignore leading zeros.  For splitting
 into sort positions, if any alphabetics (including underscore) are
-immediately adjacent to a number, a dot is assumed between them,
-so these are all equivalent:
+immediately adjacent to a number, a dot is assumed between them.
+Likewise any non-alphanumeric character is assumed to be equivalent
+to a dot.  So these are all equivalent:
 
+1.2.1alpha1.0
 1.2.1alpha1
 1.2.1.alpha1
 1.2.1alpha.1
 1.2.1.alpha.1
+1.2-1+alpha/1
 
 And these are also equivalent:
 
@@ -2567,6 +2571,7 @@
 1.2.1_1
 1.2.1._.1
 001.0002.01._.001
+1.2.1._.1.0.0.0.0.0
 
 So these are in sorted version order:
 
@@ -2584,6 +2589,16 @@
 1.2.1γ
 1.2.1
 
+Note how the last pair assume that an implicit .0 sorts after anything
+alphabetic, and that alphabetic is defined according to Unicode,
+not ASCII.  The intent of all this is to make sure that prereleases
+sort before releases.  Note also that this is still a subset of the
+versioning schemes seen in the real world.  Modules with such strange
+versions can still be used by Perl since by default Perl imports
+external modules by exact version number.  (See S11.)  Only range
+operations will be compromised by an unknown foreign collation order,
+such as a system that sorts delta after gamma.
+
 =back
 
 =head1 Context

Modified: doc/trunk/design/syn/S11.pod
==
--- doc/trunk/design/syn/S11.pod(original)
+++ doc/trunk/design/syn/S11.podThu Mar  8 10:32:50 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 1 Nov 2006
+  Last Modified: 8 Mar 2006
   Number: 11
-  Version: 15
+  Version: 16
 
 =head1 Overview
 
@@ -261,22 +261,24 @@
 
 use Dog:ver1.2.1:auth(Any);
 
-Saying C1.2.1 specifies an Iexact match on the version number,
-not a minimum match.  To match more than one version, put a range
-operator in parens:
+Saying C1.2.1 specifies an Iexact match on that part of the
+version number, not a minimum match.  To match more than one version,
+put a range operator as a selector in parens:
 
 use Dog:ver(1.2.1..1.2.3);
 use Dog:ver(1.2.1..^1.3);
 use Dog:ver(1.2.1..*);
 
-Subversions are wildcarded, so C1.2 really means C1.2.*.  If you
-say:
+When specifying the version of your own module, C1.2 is equivalent
+to C1.2.0, C1.2.0.0, and so on.  However Cuse searches for
+modules matching a version prefix, so the subversions are wildcarded,
+and in this context C1.2 really means C1.2.*.  If you say:
 
 use v6;
 
 which is short for:
 
-use Perl:ver6;
+use Perl:ver6.*;
 
 you're asking for any version of Perl 6.  You need to say something like
 
@@ -334,6 +336,21 @@
 use Whiteness:fromperl5:nameAcme::Bleachver1.12:authcpan:DCONWAY;
 use Whiteness:fromperl5 Acme::Bleach 1.12 cpan:DCONWAY;  # same thing
 
+The string form of a version recognizes the C* wildcard in place of any
+position.  It also recognizes a trailing C+, so
+
+:ver6.2.3+
+
+is short for
+
+:ver(v6.2.3 .. v6.2.*)
+
+And saying
+
+:ver6.2.0+
+
+specifically rules out any prereleases.
+
 =head1 Forcing Perl 6
 
 To get Perl 6 parsing rather than the default Perl 5 parsing,


[svn:perl6-synopsis] r14321 - doc/trunk/design/syn

2007-03-08 Thread larry
Author: larry
Date: Thu Mar  8 10:45:10 2007
New Revision: 14321

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Clarification suggested by obra++.
v-style now allows * and + wildcards for convenience.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Mar  8 10:45:10 2007
@@ -2534,11 +2534,13 @@
 =item *
 
 A version literal is written with a 'v' followed by the version
-number in dotted form.  This always constructs a CVersion object, not
-a string.  Only integers are allowed; for anything fancier you must
-coerce a string to a CVersion:
+number in dotted form.  This always constructs a CVersion object,
+not a string.  Only integers and certain wildcards are allowed;
+for anything fancier you must coerce a string to a CVersion:
 
 v1.2.3  # okay
+v1.2.*  # okay, wildcard version
+v1.2.3+ # okay, wildcard version
 v1.2.3beta  # illegal
 Version('1.2.3beta')# okay
 
@@ -2590,8 +2592,8 @@
 1.2.1
 
 Note how the last pair assume that an implicit .0 sorts after anything
-alphabetic, and that alphabetic is defined according to Unicode,
-not ASCII.  The intent of all this is to make sure that prereleases
+alphabetic, and that alphabetic is defined according to Unicode, not just
+according to ASCII.  The intent of all this is to make sure that prereleases
 sort before releases.  Note also that this is still a subset of the
 versioning schemes seen in the real world.  Modules with such strange
 versions can still be used by Perl since by default Perl imports


[svn:perl6-synopsis] r14322 - doc/trunk/design/syn

2007-03-08 Thread larry
Author: larry
Date: Thu Mar  8 19:16:14 2007
New Revision: 14322

Modified:
   doc/trunk/design/syn/S03.pod

Log:
overgreedy .* noted by thom++


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podThu Mar  8 19:16:14 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 7 Mar 2007
+  Last Modified: 8 Mar 2007
   Number: 3
-  Version: 104
+  Version: 105
 
 =head1 Overview
 
@@ -322,7 +322,7 @@
 
 Alternately, you can increment a submatch:
 
-$filename ~~ s[^.* (\w+) \.\w+$] = $().succ;
+$filename ~~ s[ ( \w+ ) \.\w+$] = $().succ;
 
 Perl 6 also supports CStr decrement.
 


[svn:perl6-synopsis] r14323 - doc/trunk/design/syn

2007-03-09 Thread larry
Author: larry
Date: Fri Mar  9 11:23:09 2007
New Revision: 14323

Modified:
   doc/trunk/design/syn/S05.pod

Log:
Add :b/:basechar modifier as suggested by ruoso++.


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Mar  9 11:23:09 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 28 Feb 2007
+   Last Modified: 9 Feb 2007
Number: 5
-   Version: 53
+   Version: 54
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -126,10 +126,26 @@
 The single-character modifiers also have longer versions:
 
  :i:ignorecase
+ :b:basechar
  :g:global
 
 =item *
 
+The C:i (or C:ignorecase) modifier causes case distinctions to be
+ignore in its lexical scope, but not in its dynamic scope.  That is,
+subrules always use their own case settings.
+
+=item *
+
+The C:b (or C:basechar) modifier scopes exactly like C:ignorecase
+except that it ignores accents instead of case.  It is equivalent
+to taking each grapheme (in both target and pattern), converting
+both to NFD (maximally decomposed) and then comparing the two base
+characters (Unicode non-mark characters) while ignoring any trailing
+mark characters.
+
+=item *
+
 The C:c (or C:continue) modifier causes the pattern to continue
 scanning from the string's current C.pos:
 
@@ -630,8 +646,9 @@
 As with a scalar variable, each element is matched as a literal
 unless it happens to be a CRegex object, in which case it is matched
 as a subrule.  As with scalar subrules, a tainted subrule always fails.
-All string values pay attention to the current C:ignorecase setting,
-while CRegex values use their own C:ignorecase settings.
+All string values pay attention to the current C:ignorecase
+and C:basechar settings, while CRegex values use their own
+C:ignorecase and C:basechar settings.
 
 When you get tired of writing:
 
@@ -733,7 +750,8 @@
 =back
 
 All hash keys, and values that are strings, pay attention to the
-C:ignorecase setting.  (Subrules maintain their own case settings.)
+C:ignorecase and C:basechar settings.  (Subrules maintain their
+own case settings.)
 
 You may combine multiple hashes under the same longest-token
 consideration by using declarative alternation:


[svn:perl6-synopsis] r14324 - doc/trunk/design/syn

2007-03-09 Thread larry
Author: larry
Date: Fri Mar  9 12:48:52 2007
New Revision: 14324

Modified:
   doc/trunk/design/syn/S05.pod

Log:
typo from perl++
clarification that :b includes mark characters in actual matched text


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Mar  9 12:48:52 2007
@@ -132,7 +132,7 @@
 =item *
 
 The C:i (or C:ignorecase) modifier causes case distinctions to be
-ignore in its lexical scope, but not in its dynamic scope.  That is,
+ignored in its lexical scope, but not in its dynamic scope.  That is,
 subrules always use their own case settings.
 
 =item *
@@ -142,7 +142,10 @@
 to taking each grapheme (in both target and pattern), converting
 both to NFD (maximally decomposed) and then comparing the two base
 characters (Unicode non-mark characters) while ignoring any trailing
-mark characters.
+mark characters.  The mark characters are ignored only for the purpose
+of determining the truth of the assertion; the actual text matched
+includes all ignored characters, including any that follow the final
+base character.
 
 =item *
 


[svn:perl6-synopsis] r14327 - doc/trunk/design/syn

2007-03-10 Thread larry
Author: larry
Date: Sat Mar 10 09:42:53 2007
New Revision: 14327

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Clarifications on StrPos and StrLen requested by putter++.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podSat Mar 10 09:42:53 2007
@@ -589,13 +589,23 @@
 graphemes, or characters in some language.  For all builtin operations,
 all CStr positions are reported as position objects, not integers.
 These CStrPos objects point into a particular string at a particular
-location independent of abstraction level.  The subtraction of two
-CStrPos objects gives a CStrLen object, which is still not an
-integer, because the string between two positions also has multiple
-integer interpretations depending on the units.  A given CStrLen
-may know that it represents 18 bytes, 7 codepoints, and 3 graphemes,
-but it knows this lazily because it actually just hangs onto the two
-CStrPos objects.  (It's much like a CRange object in that respect.)
+location independent of abstraction level, either by tracking the
+string and position directly, or by generating an abstraction-level
+independent representation of the offset from the beginning of the
+string that will give the same results if applied to the same string
+in any context.  This is assuming the string isn't modified in the
+meanwhile; a CStrPos is not a marker and is not required to follow
+changes to a mutable string.
+
+The subtraction of two CStrPos objects gives a CStrLen object,
+which is also not an integer, because the string between two positions
+also has multiple integer interpretations depending on the units.
+A given CStrLen may know that it represents 18 bytes, 7 codepoints,
+3 graphemes, and 1 letter in Malayalam, but it might only know this
+lazily because it actually just hangs onto the two CStrPos endpoints
+within the string that in turn may or may not just lazily point into
+the string.  (The lazy implementation of CStrLen is much like a
+CRange object in that respect.)
 
 If you use integers as arguments where position objects are expected,
 it will be assumed that you mean the units of the current lexically
@@ -607,6 +617,11 @@
 Of course, such a dimensional number will fail if used on a string
 that doesn't provide the appropriate abstraction level.
 
+If a CStrPos or CStrLen is forced into a numeric context, it will
+assume the units of the current Unicode abstraction level.  It is
+erroneous to pass such a non-dimensional number to a routine that
+would interpret it with the wrong units.
+
 =item *
 
 A CBuf is a stringish view of an array of


[svn:perl6-synopsis] r14328 - doc/trunk/design/syn

2007-03-10 Thread larry
Author: larry
Date: Sat Mar 10 09:55:37 2007
New Revision: 14328

Modified:
   doc/trunk/design/syn/S02.pod

Log:
further clarifications of substitution and reported string positions


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podSat Mar 10 09:55:37 2007
@@ -595,7 +595,12 @@
 string that will give the same results if applied to the same string
 in any context.  This is assuming the string isn't modified in the
 meanwhile; a CStrPos is not a marker and is not required to follow
-changes to a mutable string.
+changes to a mutable string.  For instance, if you ask for the positions
+of matches done by a substitution, the answers are reported in terms of the
+original string (which may now be inaccessible!), not as positions within
+the modified string.  (However, if you use C.pos on the modified string,
+it will report the position of the end of the substitution in terms
+of the new string.)
 
 The subtraction of two CStrPos objects gives a CStrLen object,
 which is also not an integer, because the string between two positions


[svn:perl6-synopsis] r14329 - doc/trunk/design/syn

2007-03-10 Thread larry
Author: larry
Date: Sat Mar 10 16:02:36 2007
New Revision: 14329

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Whack in rethink of caller/context


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podSat Mar 10 16:02:36 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 8 Mar 2007
+  Last Modified: 10 Mar 2007
   Number: 6
-  Version: 74
+  Version: 75
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -1678,24 +1678,65 @@
 CCapture object is generated, not when it is later bound (which
 could happen more than once).
 
-=head2 The Ccaller function
+=head2 The Ccontext and Ccaller functions
 
-The Ccaller function returns an object that describes a particular 
-higher dynamic scope, from which the current scope was called.
+The Ccontext function returns an object that describes a particular 
+dynamic scope, either the current dynamic scope or some outer dynamic
+scope from which the current scope was called.  The current context
+is numbered 0, and the immediate caller is numbered 1:
 
-say In ,   caller.sub,
- called from , caller.file,
- line ,caller.line;
-
-Ccaller may be given arguments telling it what kind of higher scope to
-look for, and how many such scopes to skip over when looking:
-
-$caller = caller;  # immediate caller
-$caller = caller Method;   # nearest caller that is method
-$caller = caller Bare; # nearest caller that is bare block
-$caller = caller Sub, :skip(2);# caller three levels up
-$caller = caller Block where { .label eq 'Foo' };
-   # caller whose label is 'Foo'
+say  file , context(1).file,
+ line , context(1).line;
+
+The Ccaller function is defined as
+
+caller ::= context.assuming(1);
+
+so the preceding example can also be written:
+
+say  file , caller.file,
+ line , caller.line;
+
+or even
+
+say  file , CALLER::$?FILE,
+ line , CALLER::$?LINE;
+
+The Ccaller function always returns the immediate caller's context,
+but the more general Ccontext function may be given arguments
+telling it which higher scope to look for.  The first argument is always
+a count of how many contexts to skip:
+
+$ctx = context(0); # context(0), my own context
+$ctx = context(1); # context(1), my caller's context
+$ctx = context(2); # context(2), my caller's caller's context
+$ctx = context($i);# $i'th caller's context
+
+The second argument is optional and is a matcher to apply against the
+context object.
+
+$ctx = context(0, Method);   # nearest context that is method
+$ctx = context(1, Method);   # 2nd nearest context that is method
+$ctx = context(0, Block);# nearest context that is block
+$ctx = context(2, Sub);  # 3rd nearest sub context
+$ctx = context(0, Block where { .label eq 'Foo' });
+# nearest context whose label is 'Foo'
+
+Note that this last potentially differs from the answer returned by
+
+Foo.context
+
+which returns the context of the innermost Foo block in the lexical scope
+rather than the dynamic scope.
+
+The returned context object has the following methods:
+
+.want
+.file
+.line
+.subname
+
+and basically anything else defined as C$?NAME there.  (XXX cop out)
 
 =head2 The Cwant function
 


[svn:perl6-synopsis] r14330 - doc/trunk/design/syn

2007-03-10 Thread larry
Author: larry
Date: Sat Mar 10 21:59:07 2007
New Revision: 14330

Modified:
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S06.pod

Log:
More fiddling with context().


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podSat Mar 10 21:59:07 2007
@@ -690,9 +690,9 @@
 caller.leave(1,2,3)
 
 Further contexts up the caller stack may be located by the selector
-that is built into the Ccaller function itself:
+that is built into the Ccontext function itself:
 
-caller({ .label eq 'LINE' }).leave(1,2,3);
+context(0, { .label eq 'LINE' }).leave(1,2,3);
 
 By default the innermost dynamic scope matching the selection criteria
 will be exited.  This can be a bit cumbersome, so in the particular
@@ -729,7 +729,7 @@
 control structures, hence the sub's lexical scope was Ialways
 the innermost dynamic scope, so the preference to the lexical scope
 in the current sub was implicit.  For Perl 6 we have to make this
-preference explicit.)  So this fallback is more like the Ccaller
+preference explicit.)  So this fallback is more like the Ccontext
 form we saw earlier.
 
 Warnings are produced in Perl 6 by throwing a resumable control

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podSat Mar 10 21:59:07 2007
@@ -1690,7 +1690,7 @@
 
 The Ccaller function is defined as
 
-caller ::= context.assuming(1);
+caller ::= context.assuming(1, *);
 
 so the preceding example can also be written:
 
@@ -1713,10 +1713,11 @@
 $ctx = context($i);# $i'th caller's context
 
 The second argument is optional and is a matcher to apply against the
-context object.
+context object.  The first argument only counts matching contexts:
 
 $ctx = context(0, Method);   # nearest context that is method
 $ctx = context(1, Method);   # 2nd nearest context that is method
+$ctx = context(1, Method).caller;# caller of that 2nd nearest method
 $ctx = context(0, Block);# nearest context that is block
 $ctx = context(2, Sub);  # 3rd nearest sub context
 $ctx = context(0, Block where { .label eq 'Foo' });
@@ -1729,20 +1730,27 @@
 which returns the context of the innermost Foo block in the lexical scope
 rather than the dynamic scope.
 
-The returned context object has the following methods:
+The returned context object supports at least the following methods:
 
 .want
+.context
+.caller
 .file
 .line
 .subname
+.lookup
 
-and basically anything else defined as C$?NAME there.  (XXX cop out)
+The C.lookup method provides access to the lexical namespace in effect
+at the given dynamic context's current position.  It may be used to look
+up ordinary lexical variables as well as special compiler variables such
+as C$?PACKAGE.  It must not be used to change any lexical variable
+that is not marked as C contextrw .
 
 =head2 The Cwant function
 
 The Cwant function returns a CSignature object that contains information
 about the context in which the current block, closure, or subroutine was
-called.
+called.  The Cwant function is really just short for Ccontext(0).want.
 
 As with normal function signatures, you can test the result of Cwant with a
 smart match (C~~) or a Cwhen:


[svn:perl6-synopsis] r14332 - doc/trunk/design/syn

2007-03-11 Thread larry
Author: larry
Date: Sun Mar 11 10:28:42 2007
New Revision: 14332

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S06.pod

Log:
turned context() into an arglist-specified navigator
defined caller more correctly as context(?ROUTINE,1)
clarified relationship of caller : CALLER :: context : CONTEXT


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podSun Mar 11 10:28:42 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 8 Mar 2007
+  Last Modified: 11 Mar 2007
   Number: 2
-  Version: 93
+  Version: 94
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1391,8 +1391,8 @@
 OUR # Package variables declared in the current package
 GLOBAL  # Builtin variables and functions
 OUTER   # Lexical variables declared in the outer scope
-CALLER  # Contextual variables in the caller's scope
-CONTEXT # Contextual variables in any caller's scope
+CALLER  # Contextual variables in the immediate caller's scope
+CONTEXT # Contextual variables in any context's scope
 SUPER   # Package variables declared in inherited classes
 COMPILING   # Lexical variables in the scope being compiled
 
@@ -1530,7 +1530,7 @@
 
 The CCONTEXT pseudo-package is just like CCALLER except that
 it scans outward through all dynamic scopes until it finds a
-contextual variable of that name in that caller's lexical scope.
+contextual variable of that name in that context's lexical scope.
 (Use of C$+FOO is equivalent to CONTEXT::$FOO or $CONTEXT::FOO.)
 If after scanning all the lexical scopes of each dynamic scope,
 there is no variable of that name, it looks in the C* package.
@@ -1538,7 +1538,7 @@
 a scalar, it then looks in C%*ENV for the identifier of the variable,
 that is, in the environment variables passed to program.  If the
 value is not found there, it returns failure.  Note that C$+_ is
-always the same as CALLER::$_ since all callers have a C$_ that
+always the same as CALLER::$_ since all contexts have a C$_ that
 is automatically considered environmental.  Note also that CCONTEXT
 and C$+ always skip the current scope, since you can always name
 the variable directly without the CCONTEXT or C+ if it's been

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podSun Mar 11 10:28:42 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 10 Mar 2007
+  Last Modified: 11 Mar 2007
   Number: 6
-  Version: 75
+  Version: 76
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -1680,61 +1680,98 @@
 
 =head2 The Ccontext and Ccaller functions
 
-The Ccontext function returns an object that describes a particular 
-dynamic scope, either the current dynamic scope or some outer dynamic
-scope from which the current scope was called.  The current context
-is numbered 0, and the immediate caller is numbered 1:
+The Ccontext function takes a list of matchers and interprets them
+as a navigation path from the current context to a location in the
+dynamic scope, either the current context itself or some context
+from which the current context was called.  It returns an object
+that describes that particular dynamic scope, or a false value if
+there is no such scope.  Numeric arguments are interpreted as number
+of contexts to skip, while non-numeric arguments scan outward for a
+context matching the argument as a smartmatch.
+
+The current context is accessed with a null argument list.
+
+say  file , context().file,
+ line , context().line;
+
+which is equivalent to:
+
+say  file , CONTEXT::$?FILE,
+ line , CONTEXT::$?LINE;
+
+The immediate caller of this context is accessed by skipping one level:
 
 say  file , context(1).file,
  line , context(1).line;
 
-The Ccaller function is defined as
+You might think that that must be the current function's caller,
+but that's not necessarily so.  This might return an outer block in
+our own routine, or even some function elsewhere that implements a
+control operator on behalf of our block.
+
+The Ccaller function is special-cased to pay attention only to
+the current CRoutine scope.  It is defined as navigating to the
+innermost scope matching ?ROUTINE (which may be a no-op when
+immediately inside a routine) and then going out one context from that:
 
-caller ::= context.assuming(1, *);
+caller ::= context.assuming(?ROUTINE,1);
 
-so the preceding example can also be written:
+So to find where the current routine was called you can say:
 
 say

[svn:perl6-synopsis] r14334 - doc/trunk/design/syn

2007-03-11 Thread larry
Author: larry
Date: Sun Mar 11 13:41:29 2007
New Revision: 14334

Modified:
   doc/trunk/design/syn/S06.pod

Log:
thinko spotted by rhr++


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podSun Mar 11 13:41:29 2007
@@ -1740,14 +1740,15 @@
 $ctx = context(1,0,1,1); # my context's context's context's context
 $ctx = context($i);  # $i'th context
 
-Repeating any smartmatch just matches the same context again unless
+Repeating any smartmatch just matches the same context again unless you
+intersperse a 1 to skip the current level:
 
 $ctx = context(Method);  # nearest context that is method
 $ctx = context(Method,Method);   # nearest context that is method
 $ctx = context(Method,1,Method); # 2nd nearest method context
 $ctx = context(Method,1,Method,1)# caller of that 2nd nearest method
 $ctx = context(1,Block); # nearest outer context that is block
-$ctx = context(Sub,Sub,Sub); # 3rd nearest sub context
+$ctx = context(Sub,1,Sub,1,Sub); # 3rd nearest sub context
 $ctx = context({ .label eq 'Foo' }); # nearest context whose label is 'Foo'
 
 Note that this last potentially differs from the answer returned by


[svn:perl6-synopsis] r14339 - doc/trunk/design/syn

2007-03-12 Thread larry
Author: larry
Date: Mon Mar 12 13:30:46 2007
New Revision: 14339

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S06.pod

Log:
Various clarifications suggested by TheDamian++
Explicit pipe target is now @(*) or @@(*).
Separated clobbering == == from pushy == and ==
Pushy pipes can now be stacked on filters as well as sinks.
$?BLOCK and other contexts now consistently return a list of labels.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon Mar 12 13:30:46 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 11 Mar 2007
+  Last Modified: 12 Mar 2007
   Number: 2
-  Version: 94
+  Version: 95
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1648,7 +1648,7 @@
 @?ROUTINE   Which nested routines am I in?
 ?BLOCK Which block am I in?
 @?BLOCK Which nested blocks am I in?
-$?LABEL Which block label am I in?
+$?LABEL Which innermost block label am I in?
 @?LABEL Which nested block labels am I in?
 
 All the nested C@? variables are ordered from the innermost to the
@@ -2472,8 +2472,8 @@
 line number range within the source file.
 
 The lexical routine itself is C?ROUTINE; you can get its name with
-CROUTINE.name.  The current block is C?BLOCK.  If the block has a label,
-that shows up in C?BLOCK.label.  Within the lexical scope of
+CROUTINE.name.  The current block is C?BLOCK.  If the block has any
+labels, those shows up in C?BLOCK.labels.  Within the lexical scope of
 a statement with a label, the label is a pseudo-object representing
 the dynamic context of that statement.  (If inside multiple dynamic
 instances of that statement, the label represents the innermost one.)

Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podMon Mar 12 13:30:46 2007
@@ -14,7 +14,7 @@
   Date: 8 Mar 2004
   Last Modified: 12 Mar 2007
   Number: 3
-  Version: 107
+  Version: 108
 
 =head1 Overview
 
@@ -50,7 +50,7 @@
 List prefix = : print push say die map substr ... [+] [*] any all
 Loose and   and
 Loose oror xor err
-Terminator  ; ==, ==, {...}, modifiers, unmatched ), ], }
+Terminator  ; ==, ==, ==, ==, {...}, modifiers, extra ), ], }
 
 If you don't see your favorite operator there, the following
 sections cover all the operators in precedence order.  Basic operator
@@ -1393,10 +1393,24 @@
 
 =item *
 
-Feed operators: ==, ==
+Feed operators: ==, ==, ==, ==
 
 source() == filter() == sink()
 
+The forms with the double angle append rather than clobber the sink's
+todo list.  The C ==  form always looks ahead for an appropriate
+target to append to, either the final sink in the chain, or the next
+filter stage with an explicit C@(*) or C@@(*) target.  This means
+you can stack multiple feeds onto one filter command:
+
+source1() ==
+source2() ==
+source3() ==
+filter(@(*)) == sink()
+
+Similar semantics apply to C ==  except it looks backward for
+an appropriate target to append to.
+
 =item *
 
 Control block: ws{...}
@@ -2521,7 +2535,7 @@
 
 $hacker.feed:xxx('Pizza and cola');
 
-is tokenized as an adverb applying to the method:
+is tokenized as an adverb applying to the method as its preceding operator:
 
 $hacker.feed :xxx('Pizza and cola');
 
@@ -2529,7 +2543,8 @@
 
 $hacker.feed: xxx('Pizza and cola');  # wrong
 
-If you want both meanings of colon, you have to put it twice:
+If you want both meanings of colon in order to supply both an adverb
+and some positional arguments, you have to put the colon twice:
 
 $hacker.feed: :xxx('Pizza and cola'), 1,2,3;
 
@@ -3366,27 +3381,30 @@
 
 =head1 Traversing arrays in parallel
 
-In order to support parallel iteration over multiple arrays, Perl 6 has
-a Czip function that builds CSeq objects from the elements of two or more
-arrays.
+In order to support parallel iteration over multiple arrays, Perl 6
+has a Czip function that builds a list of CSeq objects from the
+elements of two or more arrays.  In ordinary list context this behaves
+as a list of CCaptures and automatically flattens.
 
-for zip(@names; @codes) - [$name, $zip] {
+for zip(@names; @codes) - $name, $zip {
 print Name: $name;   Zip code: $zip\n;
 }
 
 Czip has an infix synonym, the CZ operator.
 
-To read arrays in parallel like Czip but just sequence the values
-rather than generating tuples, use Ceach instead of Czip.
+In an explicitly multidimensional list context, however, the sequences
+turn into subarrays

[svn:perl6-synopsis] r14341 - doc/trunk/design/syn

2007-03-12 Thread larry
Author: larry
Date: Mon Mar 12 14:02:52 2007
New Revision: 14341

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Typos


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podMon Mar 12 14:02:52 2007
@@ -1446,7 +1446,7 @@
 
 The Cof type that is the official return type of the routine.  Or you
 can think of of as outer/formal.  If there is no inner type, the outer
-type also serves as the inner type to constraint the return value.
+type also serves as the inner type to constrain the return value.
 
 =item Cwill do
 
@@ -1793,9 +1793,9 @@
 .subname
 
 The C.caller method is subtly different from the Ccaller
-function.  Instead of looking up the current lexically scoped
-by C.context(?ROUTINE,1), it just looks up the next matching
-C.context(Routine,1).
+function.  Instead of looking up the current lexically scoped caller
+by C.context(?ROUTINE,1), it just looks up the next matching dynamic
+caller using C.context(Routine,1).
 
 The C.my method provides access to the lexical namespace in effect at
 the given dynamic context's current position.  It may be used to look


[svn:perl6-synopsis] r14343 - doc/trunk/design/syn

2007-03-12 Thread larry
Author: larry
Date: Mon Mar 12 16:10:26 2007
New Revision: 14343

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Added the KitchenSink role.
Fiddle the feed operators to work better with files and such.


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podMon Mar 12 16:10:26 2007
@@ -15,7 +15,7 @@
   Date: 21 Mar 2003
   Last Modified: 12 Mar 2007
   Number: 6
-  Version: 78
+  Version: 79
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -886,39 +886,18 @@
 
 Because feeds are defined as lazy pipes, a chain of feeds may not begin
 and end with the same array without some kind of eager sequence point.
-That is, this doesn't work:
+That is, this isn't guaranteed to work:
 
-my @data = 1,2,3;
 @data == grep { $_ % 2 } == @data;
 
-but this does:
+either of these do:
 
-my @data = 1,2,3;
-my @tmp = eager @data;
-@data == grep { $_ % 2 } == @tmp;
-
-(But note: feed operators have push semantics when the receiver is an array.
-Use assignment to get clear-first semantics.)
-
-Conjecture: the following are possible, but only if we are very careful
-to cut loose the old @data on the blunt end of the pipe before rebinding
-the pointy end:
+@data == grep { $_ % 2 } == eager @data;
+@data == eager grep { $_ % 2 } == @data;
 
-@data == grep { $_ % 2 } == @data;
-@data := do { grep { $_ % 2 } == @data; }
-
-And this would need to force an eager evaluation to a temporary
-list to work at all:
-
-@data = do { grep { $_ % 2 } == @data; }
-
-Otherwise it's the equivalent of the Unix newbie mistake:
-
-filter foo foo
-
-Arguably we could take the Unix approach and force the newbie to just
-learn to deal with it explicitly.  (Arguably this could also be construed
-as antisocial.)
+Conjecture: if the cloning process eagerly duplicates C@data, it could
+be forced to work.  Not clear if this is desirable, since ordinary clones
+just clone the container, not the value.
 
 Leftward feeds are a convenient way of explicitly indicating the typical
 right-to-left flow of data through a chain of operations:
@@ -942,8 +921,22 @@
 level.  (Parens would also work, since a do is assumed there.)
 
 If the operand on the sharp end of a feed is not a call to a variadic
-operation, it must be something else that can be interpreted as a
-list receiver.
+operation, it must be something else that can be interpreted as a list
+receiver, or a scalar expression that can be evaluated to produce an
+object that does the CKitchenSink role, such as an CIO object.
+Such an object provides C.clear and C.push methods that will
+be called as appropriate to send data.  (Note that an CIO object
+used as a sink will force eager evaluation on its pipeline, so the
+next statement is guaranteed not to run till the file is closed.
+In contrast, an CArray object used as a sink turns into a lazy
+array.)
+
+Any non-variadic object (such as an CArray or CIO object) used as a filter
+between two feeds is treated specially as a Itap that merely captures
+data Ien passant.  You can safely install such a tap in an extended pipeline
+without changing the semantics.  An CIO object used as a tap does not
+force eager evaluation since the eagerness is controlled instead by the
+downstream feed.
 
 Any prefix list operator is considered a variadic operation, so ordinarily
 a list operator adds any feed input to the end of its list.
@@ -954,6 +947,12 @@
 foo() == say @(*),  is what I meant;
 bar() == @@(*).baz();
 
+Likewise, an CArray used as a tap may be distinguished from an CArray used
+as a translation function:
+
+numbers() == @array == bar()  # tap
+numbers() == @array[@(*)] == bar()# translation
+
 Feeding into the C* whatever term sets the source for the next sink.
 To append multiple sources to the next sink, double the angle:
 


[svn:perl6-synopsis] r14345 - doc/trunk/design/syn

2007-03-14 Thread larry
Author: larry
Date: Wed Mar 14 09:03:15 2007
New Revision: 14345

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Clarify that caller is not guaranteed to return a Routine context.
Minor refactoring of context/caller section to avoid forward ref.


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podWed Mar 14 09:03:15 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 12 Mar 2007
+  Last Modified: 14 Mar 2007
   Number: 6
-  Version: 79
+  Version: 80
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -1719,27 +1719,10 @@
 You might think that that must be the current function's caller,
 but that's not necessarily so.  This might return an outer block in
 our own routine, or even some function elsewhere that implements a
-control operator on behalf of our block.
+control operator on behalf of our block.  To get outside your current
+routine, see Ccaller below.
 
-The Ccaller function is special-cased to pay attention only to
-the current CRoutine scope.  It is defined as navigating to the
-innermost scope matching ?ROUTINE (which may be a no-op when
-immediately inside a routine) and then going out one context from that:
-
-caller ::= context.assuming(?ROUTINE,1);
-
-So to find where the current routine was called you can say:
-
-say  file , caller.file,
- line , caller.line;
-
-which is equivalent to:
-
-say  file , CALLER::$?FILE,
- line , CALLER::$?LINE;
-
-The Ccaller function always returns the immediate caller's context,
-but the more general Ccontext function may be given arguments
+The Ccontext function may be given arguments
 telling it which higher scope to look for.  Each argument is processed
 in order, left to right.  Note that CAny and C0 are no-ops:
 
@@ -1781,7 +1764,34 @@
 $ctx = context;
 $ctx = context.context.context.context;# same
 
-The returned context object supports at least the following methods:
+The Ccaller function is special-cased to pay attention only to
+the current CRoutine scope.  It is defined as navigating to the
+innermost scope matching C?ROUTINE (which may be a no-op when
+immediately inside a routine) and then going out one context from that:
+
+caller ::= context.assuming(?ROUTINE,1);
+
+So to find where the current routine was called you can say:
+
+say  file , caller.file,
+ line , caller.line;
+
+which is equivalent to:
+
+say  file , CALLER::$?FILE,
+ line , CALLER::$?LINE;
+
+Note that one context out is Inot guaranteed to be a CRoutine
+context.  You must say Ccaller(Routine) to get to the next-most-inner
+routine, which is equivalent to Ccontext(?ROUTINE,1,Routine).
+But Ccaller(Routine).line is not necessarily going to give you the
+line number that your current routine was called from; you're rather
+likely to get the line number of the topmost block that is executing
+within that outer routine, where that block contains the call to
+your routine.
+
+For either Ccontext or Ccaller,
+the returned context object supports at least the following methods:
 
 .want
 .context


[svn:perl6-synopsis] r14346 - doc/trunk/design/syn

2007-03-14 Thread larry
Author: larry
Date: Wed Mar 14 11:08:52 2007
New Revision: 14346

Modified:
   doc/trunk/design/syn/S06.pod

Log:
Further refinement of caller semantics to dwim in displaced closure calls.


Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podWed Mar 14 11:08:52 2007
@@ -1735,6 +1735,11 @@
 $ctx = context(1,0,1,1); # my context's context's context's context
 $ctx = context($i);  # $i'th context
 
+Note also that negative numbers are allowed as long as you stay within
+the existing context stack:
+
+$ctx = context(4,-1);# my context's context's context's context
+
 Repeating any smartmatch just matches the same context again unless you
 intersperse a 1 to skip the current level:
 
@@ -1764,12 +1769,15 @@
 $ctx = context;
 $ctx = context.context.context.context;# same
 
-The Ccaller function is special-cased to pay attention only to
-the current CRoutine scope.  It is defined as navigating to the
-innermost scope matching C?ROUTINE (which may be a no-op when
-immediately inside a routine) and then going out one context from that:
-
-caller ::= context.assuming(?ROUTINE,1);
+The Ccaller function is special-cased to go outward just far enough
+to escape from the current routine scope, after first ignoring any
+inner blocks that are embedded, or are otherwise pretending to be inline:
+
+caller ::= context.assuming({ !.inline }, 1);
+
+Note that this is usually the same as Ccontext(?ROUTINE,1),
+but not always.  A call to a returned closure might not even have
+C?ROUTINE in its dynamic scope anymore, but it still has a caller.
 
 So to find where the current routine was called you can say:
 
@@ -1781,10 +1789,12 @@
 say  file , CALLER::$?FILE,
  line , CALLER::$?LINE;
 
-Note that one context out is Inot guaranteed to be a CRoutine
-context.  You must say Ccaller(Routine) to get to the next-most-inner
-routine, which is equivalent to Ccontext(?ROUTINE,1,Routine).
-But Ccaller(Routine).line is not necessarily going to give you the
+Additional arguments to Ccaller are treated as navigational from the
+calling context.  One context out from your current routine is Inot
+guaranteed to be a CRoutine context.  You must say Ccaller(Routine)
+to get to the next-most-inner routine.
+
+Note that Ccaller(Routine).line is not necessarily going to give you the
 line number that your current routine was called from; you're rather
 likely to get the line number of the topmost block that is executing
 within that outer routine, where that block contains the call to
@@ -1793,18 +1803,27 @@
 For either Ccontext or Ccaller,
 the returned context object supports at least the following methods:
 
-.want
 .context
 .caller
+.leave
+.want
+.inline
 .my
 .file
 .line
 .subname
 
-The C.caller method is subtly different from the Ccaller
-function.  Instead of looking up the current lexically scoped caller
-by C.context(?ROUTINE,1), it just looks up the next matching dynamic
-caller using C.context(Routine,1).
+The C.context and C.caller methods work the same as the functions
+except that they are relative to the context supplied as invocant.
+The C.leave method can force an immediate return from the
+specified context.  The C.want method returns known smart-matchable
+characteristics of the specified context.
+
+The C.inline method says whether this block was entered implicitly
+by some surrounding control structure.  Any time you invoke a block or
+routine explicitly with C.() this is false.  However, it is defined
+to be true for any block entered using dispatcher-level primitives
+such as C.callwith, C.callsame, C.nextwith, or C.nextsame.
 
 The C.my method provides access to the lexical namespace in effect at
 the given dynamic context's current position.  It may be used to look


[svn:perl6-synopsis] r14347 - doc/trunk/design/syn

2007-03-14 Thread larry
Author: larry
Date: Wed Mar 14 11:28:03 2007
New Revision: 14347

Modified:
   doc/trunk/design/syn/S02.pod

Log:
New hyper listop that is an explicitly parallelizing variant of eager.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed Mar 14 11:28:03 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 13 Mar 2007
+  Last Modified: 14 Mar 2007
   Number: 2
-  Version: 96
+  Version: 97
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -2725,6 +2725,18 @@
 
 =item *
 
+A variant of Ceager is the Chyper list operator, which declares
+not only that you want all the values generated now, but that you want
+them badly enough that you don't care what order they're generated in.
+That is, Ceager requires sequential evaluation of the list, while
+Chyper requests (but does not require) parallel evaluation.  In any
+case, it declares that you don't care about the evaluation order.
+(Conjecture: populating a hash from a hyper list of pairs could be done
+as the results come in, such that some keys can be seen even before
+the hyper is done.  Thinking about Map-Reduce algorithms here...)
+
+=item *
+
 Signatures on non-multi subs can be checked at compile time, whereas
 multi sub and method call signatures can only be checked at run time
 (in the absence of special instructions to the optimizer).


[svn:perl6-synopsis] r14354 - doc/trunk/design/syn

2007-03-26 Thread larry
Author: larry
Date: Mon Mar 26 17:58:55 2007
New Revision: 14354

Modified:
   doc/trunk/design/syn/S05.pod

Log:
Suggestions from TheDamian++ and Juerd++ and others.
All punctuation is now treated as potentially meta.
'foo' form is gone; just use 'foo'.
Conjectural syntax positive and negative submatches of isolated substring.
Conjectural syntax for recursive calls to anonymous substructures.
 a b c  is now just a list of strings.


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podMon Mar 26 17:58:55 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 9 Feb 2007
+   Last Modified: 26 Mar 2007
Number: 5
-   Version: 54
+   Version: 55
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -77,6 +77,57 @@
 of declarative and procedural matching so that we can have the
 best of both.  See the section below on Longest-token matching.
 
+=head1 Simplified lexical parsing
+
+Unlike traditional regular expressions, Perl 6 does not require
+you to memorize an arbitrary list of metacharacters.  Instead it
+classifies characters by a simple rule.  All glyphs (graphemes)
+whose base characters are either the underscore (C_) or have
+a Unicode classification beginning with 'L' (i.e. letters) or 'N'
+(i.e. numbers) are always literal (i.e. self-matching) in regexes. They
+must be escaped with a C\ to make them metasyntactic (in which
+case that single alphanumeric character is itself metasyntactic,
+but any immediately following alphanumeric character is not).
+
+All other glyphs--including whitespace--are exactly the opposite:
+they are always considered metasyntactic (i.e. non-self-matching) and
+must be escaped or quoted to make them literal.  As is traditional,
+they may be individually escaped with C\, but in Perl 6 they may
+be also quoted as follows.
+
+Sequences of one or more glyphs of either type (i.e. any glyphs at all)
+may be made literal by placing them inside single quotes.  (Double
+quotes are also allowed, with the usual interpolative semantics.)
+Quotes create a quantifiable atom, so while
+
+moose*
+
+quantifies only the 'e' and match mooseee, saying
+
+'moose'*
+
+quantifies the whole string and would match moosemoose.
+
+Here is a table that summarizes the distinctions:
+
+AlphanumericsNon-alphanumerics Mixed
+
+Literal glyphs   a1_\*  \$  \.   \\   \'   K\-9\!
+Metasyntax  \a   \1   \_ *   $   .\'  \K-\9!
+Quoted glyphs   'a'  '1'  '_'   '*' '$' '.' '\\' '\'' 'K-9!'
+
+In other words, identifier glyphs are literal (or metasyntactic when
+escaped), non-identifier glyphs are metasyntactic (or literal when
+escaped), and single quotes make everything inside them literal.
+
+Note, however, that not all non-identifier glyphs are currently
+meaningful as metasyntax in Perl 6 regexes (e.g. C\1 C\_ C-
+C!). It is more accurate to say that all unescaped non-identifier
+glyphs are Ipotential metasyntax, and reserved for future use.
+If you use such a sequence, a helpful compile-time error is issued
+indicating that you either need to quote the sequence or define a new
+operator to recognize it.
+
 =head1 Modifiers
 
 =over
@@ -240,23 +291,27 @@
 The C:s modifier is considered sufficiently important that
 match variants are defined for them:
 
-ms/match some words/# same as m:sigspace
+mm/match some words/# same as m:sigspace
 ss/match some words/replace those words/# same as s:sigspace
 
-Conjecture: This might become sufficiently idiomatic that Cms// would
-be better as a stuttered Cmm// instead, much as Cqq// became idiomatic.
-It would also match Css/// that way.
-
 =item *
 
 New modifiers specify Unicode level:
 
- m:bytes / .**{2} /   # match two bytes
- m:codes / .**{2} /   # match two codepoints
- m:graphs/ .**{2} /   # match two graphemes
- m:langs / .**{2} /   # match two language dependent chars
-
-There are corresponding pragmas to default to these levels.
+ m:bytes  / .**{2} /   # match two bytes
+ m:codes  / .**{2} /   # match two codepoints
+ m:graphs / .**{2} /   # match two language-independent graphemes
+ m:chars  / .**{2} /   # match two characters at current max level
+
+There are corresponding pragmas to default to these levels.  Note that
+the C:chars modifier is always redundant because dot always matches
+characters at the highest level allowed in scope.  This highest level
+may be identical to one of the other three levels, or it may be more
+specific than C:graphs when a particular language's character rules

[svn:perl6-synopsis] r14355 - doc/trunk/design/syn

2007-03-26 Thread larry
Author: larry
Date: Mon Mar 26 18:10:55 2007
New Revision: 14355

Modified:
   doc/trunk/design/syn/S03.pod

Log:
typo from dduncan++


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podMon Mar 26 18:10:55 2007
@@ -3196,7 +3196,7 @@
 constant (@foo = 1,2,3);# wrong: 2 and 3 are not variable names
 
 When parentheses are omitted, you may use an infix assignment operator
-instea dof C= as the initializer.  In that case, the left hand side of
+instead of C= as the initializer.  In that case, the left hand side of
 the infix operator will be the variable's prototype object:
 
 constant Dog $fido .= new;  # okay: a constant Dog object


[svn:perl6-synopsis] r14356 - doc/trunk/design/syn

2007-03-28 Thread larry
Author: larry
Date: Wed Mar 28 12:46:50 2007
New Revision: 14356

Modified:
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S06.pod

Log:
Simplified - binding not to autoalias $_ to first arg, per TheDamian++
Also clarified why when must always break from immediately surrounding block.
Juerd++'s double-pointy block now allowed as convenient way to make all
parameters default to rw.
Implicit $_ arg now defined in terms of -


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podWed Mar 28 12:46:50 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 12 Mar 2007
+  Last Modified: 28 Mar 2007
   Number: 4
-  Version: 54
+  Version: 55
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -390,8 +390,23 @@
 
 for =$*ARGS {...}
 
-Parameters are by default readonly within the block.  You can
-declare a parameter read/write by including the Cis rw trait.
+Arguments bound to the formal parameters of a pointy block are by
+default readonly within the block.  You can declare a parameter
+read/write by including the Cis rw trait.  The following treats
+every other value in C@values as modifiable:
+
+for @values - $even is rw, $odd { ... }
+
+In the case where you want all your parameters to default to Crw,
+you may use the visually suggestive double-ended arrow to indicate that
+values flow both ways:
+
+for @values - $even, $odd { ... }
+
+This is equivalent to
+
+for @values - $even is rw, $odd is rw { ... }
+
 If you rely on C$_ as the implicit parameter to a block,
 then C$_ is considered read/write by default.  That is,
 the construct:
@@ -400,10 +415,9 @@
 
 is actually short for:
 
-for @foo - $_ is rw {...}
+for @foo - $_ {...}
 
-so you can modify the current list element in that case.  However,
-any time you specify the arguments, they default to read only.
+so you can modify the current list element in that case.
 
 When used as statement modifiers, Cfor and Cgiven use a private
 instance of C$_ for the left side of the statement.  The outer C$_
@@ -551,16 +565,20 @@
 }
 
 The current topic is always aliased to the special variable C$_.
-The Cgiven block is just one way to set the current topic, but a
-switch statement can be any block that sets C$_, including a Cfor
-loop (in which the first loop parameter is the topic) or the body
-of a method (if you have declared the invocant as C$_).  So switching
-behavior is actually caused by the Cwhen statements in the block,
-not by the nature of the block itself.  A Cwhen statement implicitly
-does a smart match between the current topic (C$_) and the argument
-of the Cwhen.  If the smart match succeeds, Cwhen's associated block
-is executed, and the surrounding block is automatically broken out of.
-The value of the inner block is returned as the value of the outer block.
+The Cgiven block is just one way to set the current topic, but
+a switch statement can be any block that sets C$_, including a
+Cfor loop (assuming one of its loop variables is bound to C$_)
+or the body of a method (if you have declared the invocant as C$_).
+So switching behavior is actually caused by the Cwhen statements in
+the block, not by the nature of the block itself.  A Cwhen statement
+implicitly does a smart match between the current topic (C$_) and
+the argument of the Cwhen.  If the smart match succeeds, Cwhen's
+associated block is executed, and the immediatly surrounding block
+is automatically broken out of.  (If that is not the block you wish
+to leave, you must use the CLABEL.leave method to be more specific,
+since the compiler may find it difficult to guess which surrounding
+construct last set C$_ as the topic.)  The value of the inner block
+is returned as the value of the outer block.
 
 If the smart match fails, control passes to the next statement
 normally, which may or may not be a Cwhen statement.  Since Cwhen
@@ -583,14 +601,12 @@
 fall off the last Cwhen into ordinary code.  But use of a Cdefault
 block is good documentation.
 
-If you use a Cfor loop with a named parameter, the parameter is
-also aliased to C$_ so that it can function as the topic of any
-Cwhen statements within the loop.  If you use a Cfor statement
-with multiple parameters, only the first parameter is aliased to C$_
-as the topic.
+If you use a Cfor loop with a parameter named C$_ (either
+explicitly or implicitly), that parameter can function as the topic
+of any Cwhen statements within the loop.
 
 You can explicitly break out of a Cwhen block (and its surrounding
-switch) early using the Cbreak verb.  You can explicitly break out
+block) early using the Cbreak verb.  You can explicitly break out
 of a Cwhen block and go to the next statement by using Ccontinue.
 (Note that, unlike C's idea

[svn:perl6-synopsis] r14357 - doc/trunk/design/syn

2007-03-28 Thread larry
Author: larry
Date: Wed Mar 28 13:17:43 2007
New Revision: 14357

Modified:
   doc/trunk/design/syn/S04.pod

Log:
Tweaked when/break to leave innermost block with formal $_ (also TheDamian++)


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podWed Mar 28 13:17:43 2007
@@ -14,7 +14,7 @@
   Date: 19 Aug 2004
   Last Modified: 28 Mar 2007
   Number: 4
-  Version: 55
+  Version: 56
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -573,12 +573,14 @@
 the block, not by the nature of the block itself.  A Cwhen statement
 implicitly does a smart match between the current topic (C$_) and
 the argument of the Cwhen.  If the smart match succeeds, Cwhen's
-associated block is executed, and the immediatly surrounding block
-is automatically broken out of.  (If that is not the block you wish
-to leave, you must use the CLABEL.leave method to be more specific,
-since the compiler may find it difficult to guess which surrounding
-construct last set C$_ as the topic.)  The value of the inner block
-is returned as the value of the outer block.
+associated block is executed, and the innermost surrounding block
+that has C$_ as one of its formal parameters (either explicit
+or implicit) is automatically broken out of.  (If that is not the
+block you wish to leave, you must use the CLABEL.leave method to
+be more specific, since the compiler may find it difficult to guess
+which surrounding construct was intended as the actual topicalizer.)
+The value of the inner block is returned as the value of the outer
+block.
 
 If the smart match fails, control passes to the next statement
 normally, which may or may not be a Cwhen statement.  Since Cwhen
@@ -605,8 +607,12 @@
 explicitly or implicitly), that parameter can function as the topic
 of any Cwhen statements within the loop.
 
-You can explicitly break out of a Cwhen block (and its surrounding
-block) early using the Cbreak verb.  You can explicitly break out
+You can explicitly break out of a Cwhen block (and its surrounding 
topicalizer
+block) early using the Cbreak verb.  More precidely, it leaves the
+innermost block outside the Cwhen that uses C$_ as one of its formal
+parameters, either explicitly or implicitly.
+
+You can explicitly break out
 of a Cwhen block and go to the next statement by using Ccontinue.
 (Note that, unlike C's idea of falling through, subsequent Cwhen
 conditions are evaluated.  To jump into the next Cwhen block you


[svn:perl6-synopsis] r14358 - doc/trunk/design/syn

2007-03-28 Thread larry
Author: larry
Date: Wed Mar 28 14:42:41 2007
New Revision: 14358

Modified:
   doc/trunk/design/syn/S04.pod

Log:
typo from Juerd++


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podWed Mar 28 14:42:41 2007
@@ -608,7 +608,7 @@
 of any Cwhen statements within the loop.
 
 You can explicitly break out of a Cwhen block (and its surrounding 
topicalizer
-block) early using the Cbreak verb.  More precidely, it leaves the
+block) early using the Cbreak verb.  More precisely, it leaves the
 innermost block outside the Cwhen that uses C$_ as one of its formal
 parameters, either explicitly or implicitly.
 


[svn:perl6-synopsis] r14359 - doc/trunk/design/syn

2007-03-28 Thread larry
Author: larry
Date: Wed Mar 28 19:28:28 2007
New Revision: 14359

Modified:
   doc/trunk/design/syn/S09.pod

Log:
User-definable array indexing hammered out by TheDamian++ and Dataweaver++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podWed Mar 28 19:28:28 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 13 Sep 2004
-  Last Modified: 14 Mar 2007
+  Last Modified: 28 Mar 2007
   Number: 9
-  Version: 18
+  Version: 19
 
 =head1 Overview
 
@@ -146,6 +146,87 @@
 buffer type.  The unpacking is performed by coercion of such a buffer
 type back to the type of the compact struct.
 
+=head1 Standard array indexing
+
+Standard array indices are specified using square brackets. Standard
+indices always start at zero in each dimension of the array (see
+LMultidimensional arrays), and are always contiguous:
+
+@dwarves[0] = Happy;   # The 1st dwarf
+@dwarves[6] = Doc; # The 7th dwarf
+
+@seasons[0] = Spring;  # The 1st season
+@seasons[2] = Autumn|Fall;   # The 3rd season
+
+
+=head1 Fixed-size arrays
+
+A basic array declaration like:
+
+my @array;
+
+declares a one-dimensional array of indeterminate length. Such arrays
+are autoextending. For many purposes, though, it's useful to define
+array types of a particular size and shape that, instead of
+autoextending, fail if you try to access outside their
+declared dimensionality. Such arrays tend to be faster to allocate and
+access as well. (The language must, however, continue to protect you
+against overflow--these days, that's not just a reliability issue, but
+also a security issue.)
+
+To declare an array of fixed size, specify its maximum number of elements
+in square brackets immediately after its name:
+
+my @dwarves[7];   # Valid indices are 0..6
+
+my @seasons[4];   # Valid indices are 0..4
+
+No intervening whitespace is permitted between the name and the size
+specification, but unspace is allowed:
+
+my @values[10];   # Okay
+my @keys  [10];   # Error
+my @keys\ [10];   # Okay
+
+Note that the square brackets are a compile-time declarator, not a run-time
+operator, so you can't use the dotted form either:
+
+my @values.[10];  # Error
+my @keys\ .[10];  # Error
+
+Attempting to access an index outside a array's defined range will fail:
+
+@dwarves[7] = 'Sneaky';   # Fails with invalid index exception
+
+It's also possible to explicitly specify a normal autoextending array:
+
+my @vices[*]; # Length is: whatever
+  # Valid indices are 0..*
+
+=head1 Typed arrays
+
+The type of value stored in each element of the array (normally CAny)
+can be explicitly specified too, as an external Cof type:
+
+my num @nums; # Each element stores a native number
+my @nums of num;  # Same
+
+my Book @library[1_000_000];  # Each element stores a Book object
+my @library[1_000_000] of Book;   # Same
+
+Alternatively, the element storage type may be specified as part of the
+dimension specifier (much like a subroutine definition):
+
+my @nums[--num];
+
+my @library[1_000_000 -- Book];
+
+Arrays may also be defined with a mixture of fixed and autoextending
+dimensions:
+
+my @calendar[12;*;24]; # Month dimension unlimited
+
+
 =head1 Compact arrays
 
 In declarations of the form:
@@ -166,6 +247,10 @@
 hard to make these elements look like objects when you treat them
 like objects--this is called autoboxing.)
 
+Such arrays are autoextending just like ordinary Perl arrays
+(at the price of occasionally copying the block of data to another
+memory location, or using a tree structure).
+
 A compact array is for most purposes interchangeable with the
 corresponding buffer type.  For example, apart from the sigil,
 these are equivalent declarations:
@@ -204,33 +289,45 @@
 known encoding.  Otherwise you must encode them explicitly from the
 higher-level abstraction into some buffer type.)
 
+
 =head1 Multidimensional arrays
 
-The declarations above declare one-dimensional arrays of indeterminate
-length.  Such arrays are autoextending just like ordinary Perl arrays
-(at the price of occasionally copying the block of data to another
-memory location, or using a tree structure).  For many purposes,
-though, it's useful to define array types of a particular size and
-shape that, instead of autoextending, throw an exception if you try
-to access outside their declared dimensionality.  Such arrays tend
-to be faster to allocate and access as well.  (The language must,
-however, continue to protect you against overflow--these days, that's
-not just a reliability issue, but also a security issue.)
+Perl 6 arrays are not restricted to being one

[svn:perl6-synopsis] r14360 - doc/trunk/design/syn

2007-03-28 Thread larry
Author: larry
Date: Wed Mar 28 23:21:49 2007
New Revision: 14360

Modified:
   doc/trunk/design/syn/S09.pod

Log:
Clarifications requested by spinclad++ and Bob Rogers++.


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podWed Mar 28 23:21:49 2007
@@ -179,7 +179,7 @@
 
 my @dwarves[7];   # Valid indices are 0..6
 
-my @seasons[4];   # Valid indices are 0..4
+my @seasons[4];   # Valid indices are 0..3
 
 No intervening whitespace is permitted between the name and the size
 specification, but unspace is allowed:
@@ -222,9 +222,10 @@
 my @library[1_000_000 -- Book];
 
 Arrays may also be defined with a mixture of fixed and autoextending
-dimensions:
+dimensions.  There are always 12 months in a year and 24 hours in a day,
+but the number of days in the month can vary:
 
-my @calendar[12;*;24]; # Month dimension unlimited
+my @calendar[12;*;24]; # day-of-month dimension unlimited/ragged
 
 
 =head1 Compact arrays


[svn:perl6-synopsis] r14361 - doc/trunk/design/syn

2007-03-28 Thread larry
Author: larry
Date: Wed Mar 28 23:32:40 2007
New Revision: 14361

Modified:
   doc/trunk/design/syn/S09.pod

Log:
Clarification suggested by gaal++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podWed Mar 28 23:32:40 2007
@@ -222,8 +222,9 @@
 my @library[1_000_000 -- Book];
 
 Arrays may also be defined with a mixture of fixed and autoextending
-dimensions.  There are always 12 months in a year and 24 hours in a day,
-but the number of days in the month can vary:
+dimensions (see below).  For example, there are always 12 months in
+a year and 24 hours in a day, but the number of days in the month
+can vary:
 
 my @calendar[12;*;24]; # day-of-month dimension unlimited/ragged
 


[svn:perl6-synopsis] r14362 - doc/trunk/design/syn

2007-03-29 Thread larry
Author: larry
Date: Thu Mar 29 00:55:18 2007
New Revision: 14362

Modified:
   doc/trunk/design/syn/S09.pod

Log:
typo spotted by Ruud++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podThu Mar 29 00:55:18 2007
@@ -194,7 +194,7 @@
 my @values.[10];  # Error
 my @keys\ .[10];  # Error
 
-Attempting to access an index outside a array's defined range will fail:
+Attempting to access an index outside an array's defined range will fail:
 
 @dwarves[7] = 'Sneaky';   # Fails with invalid index exception
 


[svn:perl6-synopsis] r14363 - doc/trunk/design/syn

2007-03-29 Thread larry
Author: larry
Date: Thu Mar 29 07:11:09 2007
New Revision: 14363

Modified:
   doc/trunk/design/syn/S09.pod

Log:
missing blank line supplied by dduncan++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podThu Mar 29 07:11:09 2007
@@ -861,6 +861,7 @@
 0 .. Inf :by(2)
 
 That's why we have C..* to mean C..Inf.
+
 =head1 PDL signatures
 
 To rewrite a Perl 5 PDL definition like this:


[svn:perl6-synopsis] r14364 - doc/trunk/design/syn

2007-03-29 Thread larry
Author: larry
Date: Thu Mar 29 12:06:16 2007
New Revision: 14364

Modified:
   doc/trunk/design/syn/S09.pod

Log:
error spotted by TSa++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podThu Mar 29 12:06:16 2007
@@ -682,7 +682,7 @@
 Similarly, within a C.{} indexing operation you can use C*[$idx]
 to convert from standard indices to user-defined:
 
-@lengths{ *[2] .. Oct }  # Same as:  @lengths{ Jan .. Oct }
+@lengths{ *[2] .. Oct }  # Same as:  @lengths{ Mar .. Oct }
 
 In other words, when treated as an array within an indexing
 operation, C* allows you to convert between standard and


[svn:perl6-synopsis] r14365 - doc/trunk/design/syn

2007-03-29 Thread larry
Author: larry
Date: Thu Mar 29 12:32:03 2007
New Revision: 14365

Modified:
   doc/trunk/design/syn/S04.pod

Log:
missing words spotted by shamu++


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podThu Mar 29 12:32:03 2007
@@ -854,8 +854,8 @@
NEXT {...}   at loop continuation time, before any LEAVE
LAST {...}   at loop termination time, after any LEAVE
 
-PRE {...}   assert precondition at every block entry, before any
-   POST {...}   assert postcondition at every block exit, after any
+PRE {...}   assert precondition at every block entry, before ENTER
+   POST {...}   assert postcondition at every block exit, after LEAVE
 
   CATCH {...}   catch exceptions, before LEAVE
 CONTROL {...}   catch control exceptions, before LEAVE


[svn:perl6-synopsis] r14366 - doc/trunk/design/syn

2007-03-29 Thread larry
Author: larry
Date: Thu Mar 29 16:14:45 2007
New Revision: 14366

Modified:
   doc/trunk/design/syn/S09.pod

Log:
clarifications suggested by thom++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podThu Mar 29 16:14:45 2007
@@ -387,12 +387,12 @@
 final dimension to make a ragged array functionally equivalent to an
 array of arrays:
 
-my int @ints[42; *];# Second dimension unlimited
+my int @ints[42; *];# Second dimension unlimited/ragged
 push(@ints[41], getsomeints());
 
 but Iany dimensional of an array may be declared as autoextending:
 
-my @calendar[12;*;24];  # Month dimension unlimited
+my @calendar[12;*;24];  # day-of-month dimension unlimited/ragged
 @calendar[1;42;8] = 'meeting'   # See you on January 42nd
 
 It is also possible to specify that an array has an arbitrary number


[svn:perl6-synopsis] r14367 - doc/trunk/design/syn

2007-03-31 Thread larry
Author: larry
Date: Sat Mar 31 18:59:24 2007
New Revision: 14367

Modified:
   doc/trunk/design/syn/S05.pod

Log:
quoting braino noticed by moritz++


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podSat Mar 31 18:59:24 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 26 Mar 2007
+   Last Modified: 31 Mar 2007
Number: 5
-   Version: 55
+   Version: 56
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -3064,7 +3064,7 @@
 For example:
 
  if $text ~~ mm:g/ (\S+:) rocks / {
- say 'Full match context is: [$/]';
+ say Full match context is: [$/];
  }
 
 But the list of individual match objects corresponding to each separate


[svn:perl6-synopsis] r14369 - doc/trunk/design/syn

2007-04-04 Thread larry
Author: larry
Date: Wed Apr  4 17:43:14 2007
New Revision: 14369

Modified:
   doc/trunk/design/syn/S09.pod

Log:
Reorganization suggested by Jonathan Lang++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podWed Apr  4 17:43:14 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 13 Sep 2004
-  Last Modified: 28 Mar 2007
+  Last Modified: 4 Apr 2007
   Number: 9
-  Version: 19
+  Version: 20
 
 =head1 Overview
 
@@ -221,13 +221,6 @@
 
 my @library[1_000_000 -- Book];
 
-Arrays may also be defined with a mixture of fixed and autoextending
-dimensions (see below).  For example, there are always 12 months in
-a year and 24 hours in a day, but the number of days in the month
-can vary:
-
-my @calendar[12;*;24]; # day-of-month dimension unlimited/ragged
-
 
 =head1 Compact arrays
 
@@ -302,6 +295,12 @@
 
 my @calendar[12;31;24]; # Valid indices are 0..11 ; 0..30 ; 0..23
 
+Arrays may also be defined with a mixture of fixed and autoextending
+dimensions.  For example, there are always 12 months in a year and
+24 hours in a day, but the number of days in the month can vary:
+
+my @calendar[12;*;24]; # day-of-month dimension unlimited/ragged
+
 You can pass a multislice for the shape as well:
 
 @@shape = (4;2);


[svn:perl6-synopsis] r14370 - doc/trunk/design/syn

2007-04-12 Thread larry
Author: larry
Date: Thu Apr 12 17:11:56 2007
New Revision: 14370

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Clarify the single-character backslash escapes, including \c control forms.
Note that \c[ is not legal to mean \c[ESCAPE]


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Apr 12 17:11:56 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 16 Mar 2007
+  Last Modified: 12 Apr 2007
   Number: 2
-  Version: 100
+  Version: 101
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -2274,7 +2274,15 @@
 
 Backslash sequences still interpolate, but there's no longer any C\v
 to mean Ivertical tab, whatever that is...  (C\v now match vertical
-whitespace in a regex.)
+whitespace in a regex.)  Literal character representations are:
+
+\a  BELL
+\b  BACKSPACE
+\t  TAB
+\n  LINE FEED
+\f  FORM FEED
+\r  CARRIAGE RETURN
+\e  ESCAPE
 
 =item *
 
@@ -2302,6 +2310,22 @@
 
 [Note: none of the official Unicode character names contains comma.]
 
+(Within a regex you may also use C\C to match a character that is
+not the specified character.)
+
+If the character following C\c or C\C is not a left square bracket,
+the single following character is turned into a control character by
+the usual trick of XORing the 64 bit.  This allows C\c@ for NULL
+and C\c? for DELETE, but note that the ESCAPE character may not be
+represented that way; it must be represented something like:
+
+\e
+\c[ESCAPE]
+\x1B
+\o33
+
+Obviously C\e is preferred when brevity is needed.
+
 =item *
 
 There are no barewords in Perl 6.  An undeclared bare identifier will


[svn:perl6-synopsis] r14371 - doc/trunk/design/syn

2007-04-12 Thread larry
Author: larry
Date: Thu Apr 12 17:20:55 2007
New Revision: 14371

Modified:
   doc/trunk/design/syn/S02.pod

Log:
typo


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Apr 12 17:20:55 2007
@@ -2273,7 +2273,7 @@
 =item *
 
 Backslash sequences still interpolate, but there's no longer any C\v
-to mean Ivertical tab, whatever that is...  (C\v now match vertical
+to mean Ivertical tab, whatever that is...  (C\v now matches vertical
 whitespace in a regex.)  Literal character representations are:
 
 \a  BELL


[svn:perl6-synopsis] r14372 - doc/trunk/design/syn

2007-04-13 Thread larry
Author: larry
Date: Fri Apr 13 10:02:01 2007
New Revision: 14372

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Clarification of simplified return values of filetests for brian.d.foy++.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podFri Apr 13 10:02:01 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 16 Mar 2007
+  Last Modified: 13 Apr 2007
   Number: 3
-  Version: 110
+  Version: 111
 
 =head1 Overview
 
@@ -1477,30 +1477,36 @@
 
 =item *
 
-The filetest operators are gone.  We now use a Pair as either a
+The filetest operators are gone.  We now use a CPair as either a
 pattern or a method name to get the same effect:
 
 if $filename ~~ :e { say exists }
 if $filename.:e { say exists }
 
-Both of these forms actually translate to
-
-if $filename.STATUS(:e) { say exists }
-
-which is a generic mechanism that dispatches to the object's
-class to find the definition of CSTATUS.  (It just happens that CStr
-(filenames) and CIO (filehandles) default to the expected filetest
-semantics, but C$regex.:i might tell you whether the regex is case
-insensitive, for instance.)
+The 1st form actually translates to the latter form, so the object's
+class decides how to dispatch pair methods.  It just happens that
+CStr (filenames), CIO (filehandles), and CStatbuf (stat buffers)
+default to the expected filetest semantics, but C$regex.:i might
+tell you whether the regex is case insensitive, for instance.
 
 Using the pattern form, multiple tests may be combined via junctions:
 
 given $handle {
-when all :r :w :x {...}
+when :r  :w  :x {...}
 when :!w | :!x{...}
 when *{...}
 }
 
+When adverbial pairs are stacked into one term, it is assumed they are
+ANDed together, so
+
+when :r :w :x
+
+is equivalent to either of:
+
+when :r  :w  :x
+when all(:r,:w,:x)
+
 The advantage of the method form is that it can be used in places that
 require tighter precedence than C~~ provides:
 
@@ -1510,13 +1516,23 @@
 
 sort { .:M }, @files
 
-But that demonstrates the other advantage of the method form.
+But that demonstrates the other advantage of the method form, which is
+that it allows the unary dot syntax to test the current topic.
+
+Unlike in earlier versions of Perl 6, these filetests do not return
+stat buffers, but simple scalars of type CBool, CInt, or CNum.
 
-In general, the user need not worry about caching the stat buffer.
-The stat buffer will automatically be reused if the same object has
-recently been queried, where recently is defined as less than a
-second or so.  If this is a concern, an explicit stat() or lstat()
-on that file will automatically reset the stat buffer for that file.
+In general, the user need not worry about caching the stat buffer
+when a filename is queried.  The stat buffer will automatically be
+reused if the same object has recently been queried, where recently
+is defined as less than a second or so.  If this is a concern, an
+explicit stat() or lstat() may be used to return an explicit stat
+buffer object that will not be subject to timeout, and may be tested
+repeatedly just as a filename or handle can.  A CStatbuf object has
+a C.file method that can be queried for its filename (if known);
+the C.io method returns the handle (if known).  If the CStatbuf
+object doesn't know its filename but does know its IO handle, then
+C.file attempts to return C.io.file.
 
 Note that C:s still returns the filesize, but C:!s is true
 only if the file is of size 0.


[svn:perl6-synopsis] r14373 - doc/trunk/design/syn

2007-04-13 Thread larry
Author: larry
Date: Fri Apr 13 16:23:17 2007
New Revision: 14373

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Ranges over enums and such also can use *, suggested by Jonathan Lang++


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podFri Apr 13 16:23:17 2007
@@ -14,7 +14,7 @@
   Date: 8 Mar 2004
   Last Modified: 13 Apr 2007
   Number: 3
-  Version: 111
+  Version: 112
 
 =head1 Overview
 
@@ -749,7 +749,7 @@
 These operators compare their operands using numeric, string,
 or Ceqv semantics respectively, and depending on the order return
 one of COrder::Increase, COrder::Same, or COrder::Decrease
-(which numerify to -1, 0, or +1).  See L/Comparion semantics.
+(which numerify to -1, 0, or +1).  See L/Comparison semantics.
 
 =item *
 
@@ -2104,18 +2104,20 @@
 2.1 ~~ 1..2# false, equivalent to 1 = 2.1 = 2
 
 If a C* (see the Whatever type in S02) occurs on the right side
-of a range, it is taken to mean positive infinity in whatever space
-the range is operating.  A C* on the left means negative infinity
-for types that support negative values. (The sign of those infinities
-reverses for a negative step.)  If the C* occurs on one side but
-not the other, the type is inferred from the other argument.  A star
-on both sides will match any value that supports the COrdered role.
+of a range, it is taken to mean positive infinity in whatever
+typespace the range is operating, as inferred from the left operand.
+A C* on the left means negative infinity for types that support
+negative values, and the first value in the typespace otherwise as
+inferred from the right operand.  (For signed infinities the signs
+reverse for a negative step.)  A star on both sides prevents any type
+from being inferred other than the COrdered role.
 
 0..*# 0 .. +Inf
 'a'..*  # 'a' .. 'z...'
 *..0# -Inf .. 0
 *..*# -Inf .. +Inf, really Ordered
 1.2.3..*# Any version higher than 1.2.3.
+May..*  # May through December
 
 Note: infinite lists are constructed lazily.  And even though C*..*
 can't be constructed at all, it's still useful as a selector object.


[svn:perl6-synopsis] r14374 - doc/trunk/design/syn

2007-04-13 Thread larry
Author: larry
Date: Fri Apr 13 17:59:55 2007
New Revision: 14374

Modified:
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S12.pod

Log:
Eliminated STATUS in favor of normal dispatch to :foo pair-handling methods.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podFri Apr 13 17:59:55 2007
@@ -14,7 +14,7 @@
   Date: 8 Mar 2004
   Last Modified: 13 Apr 2007
   Number: 3
-  Version: 112
+  Version: 113
 
 =head1 Overview
 
@@ -2266,7 +2266,7 @@
 Any   Num   numeric equality+$_ == X
 Any   Str   string equality ~$_ eq X
 
-Any   Pair  test object .STATUS(X) (Str,IO do filetest)
+Any   Pair  test object .:Xkey(Xval) (e.g. filetests)
 
 Set   Set   identical sets  $_ === X
 Hash  Set   hash keys same set  $_.keys === X

Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podFri Apr 13 17:59:55 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 11 Mar 2007
+  Last Modified: 13 Apr 2007
   Number: 12
-  Version: 45
+  Version: 46
 
 =head1 Overview
 
@@ -613,26 +613,15 @@
 =head1 Pair query methods
 
 Certain classes such as filehandles allow colon pairs to be used as if they
-were methods.  When you say:
+were methods.  Method names beginning with a colon:
 
 $filehandle.:e
 $filehandle.:!x
 
-it actually calls
-
-$filehandle.STATUS(:e)
-$filehandle.STATUS(:!x)
-
-which is expected to return a value that can be used as a boolean.
+are expected to return a value that can be used as a boolean.
 While this is primarily intended for use by file tests, other classes
-may define a CSTATUS method to provide a similar mechanism for interrogating
-lightweight properties without having to define methods for all of them.
-
-Note, though, that Iall such queries are answered by the first located
-CSTATUS method--they are not inherited independently.  The CSTATUS method
-must explicitly pass the query on to other classes in such cases.  Likewise,
-if conflicting CSTATUS methods are composed from two different roles, they
-must be disambiguated as any other conflicting method would be.
+may define such methods to provide a similar mechanism for interrogating
+properties.
 
 Depending on the class, the pairs in question may have arguments.
 The CHash class in particular makes use of pair syntax for subscript
@@ -643,7 +632,10 @@
 
 This has the advantage that the pair's argument is actually parsed exactly
 as a subscript would be.  A C.exists() method could not easily make
-such a guarantee about its arguments.
+such a guarantee about its arguments.  Plus you can say:
+
+%hash.:existsfoo
+%hash.:deletefoo
 
 Conjecture, the trailing subscript adverbs could be brought up front as
 well:


[svn:perl6-synopsis] r14375 - doc/trunk/design/syn

2007-04-16 Thread larry
Author: larry
Date: Mon Apr 16 09:59:02 2007
New Revision: 14375

Modified:
   doc/trunk/design/syn/S11.pod

Log:
Module names must respect case sensitivity even on case-insensitive systems.


Modified: doc/trunk/design/syn/S11.pod
==
--- doc/trunk/design/syn/S11.pod(original)
+++ doc/trunk/design/syn/S11.podMon Apr 16 09:59:02 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 9 Mar 2006
+  Last Modified: 16 Apr 2007
   Number: 11
-  Version: 17
+  Version: 18
 
 =head1 Overview
 
@@ -202,6 +202,20 @@
 where to keep them, such that multiple versions by different authors
 can coexist, all of them available to any installed version of Perl.
 
+The internal API for package names is always case-sensitive, even if
+the library system is hosted on a system that is not case-sensitive.
+This implies either some sort of name mangling capability or storage
+of intermediate products into a database of some sort.  In any event,
+the actual storage location must be encapsulated in the library system
+such that it is hidden from all language level naming constructs.
+(Provision must be made for interrogating the library system for
+the actual location of a module, of course, but this falls into
+the category of introspection.)  Note also that distributions
+need to be distributed in a way that they can be installed on
+case-insensitive systems without loss of information.  That's fine,
+but the language-level abstraction must not leak details of this
+mechanism without the user asking for the details to be leaked.
+
 The syntax of a versioned module or class declaration has multiple
 parts in which the non-identifier parts are specified in adverbial pair
 notation without intervening spaces.  Internally these are stored in


[svn:perl6-synopsis] r14376 - doc/trunk/design/syn

2007-04-17 Thread larry
Author: larry
Date: Tue Apr 17 11:22:38 2007
New Revision: 14376

Modified:
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S05.pod

Log:
Note that unless no longer allows an else
Clarification of binding semantics of if, elsif, and else
Clarification of C... requested by moritz++


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podTue Apr 17 11:22:38 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 28 Mar 2007
+  Last Modified: 17 Apr 2007
   Number: 4
-  Version: 56
+  Version: 57
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -175,8 +175,8 @@
 
 =head1 Conditional statements
 
-The Cif and Cunless statements work almost exactly as they do in
-Perl 5, except that you may omit the parentheses on the conditional:
+The Cif and Cunless statements work much as they do in
+Perl 5.  However, you may omit the parentheses on the conditional:
 
 if $foo == 123 {
 ...
@@ -192,6 +192,24 @@
 branch, the return value is Cundef in item context and C() in
 list context.
 
+The Cunless statement does not allow an Celsif or Celse in Perl 6.
+
+The value of the conditional expression may be optionally bound to
+a closure parameter:
+
+iftesta() - $a { say $a }
+elsif testb() - $b { say $b }
+else  - $b { say $b }
+
+Note that the value being evaluated for truth and subsequently bound is
+not necessarily a value of type Bool.  (All normal types in Perl may
+be evaluated for truth.  In fact, this construct would be relatively
+useless if you could bind only boolean values as parameters, since
+within the closure you already know whether it evaluated to true
+or false.)  Binding within an Celse automatically binds the value
+tested by the previous Cif or Celsif, which, while known to be
+false, might nevertheless be an Iinteresting value of false.
+
 Conditional statement modifiers work as in Perl 5.  So do the
 implicit conditionals implied by short-circuit operators.  Note though that
 the first expression within parens or brackets is parsed as a statement,

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podTue Apr 17 11:22:38 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 31 Mar 2007
+   Last Modified: 17 Apr 2007
Number: 5
-   Version: 56
+   Version: 57
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -1137,7 +1137,7 @@
 =item *
 
 A leading C[ or C+ indicates an enumerated character class.  Ranges
-in enumerated character classes are indicated with C...
+in enumerated character classes are indicated with C.. rather than C-.
 
  / [a..z_]* /
  / +[a..z_]* /


[svn:perl6-synopsis] r14377 - doc/trunk/design/syn

2007-04-17 Thread larry
Author: larry
Date: Tue Apr 17 11:26:03 2007
New Revision: 14377

Modified:
   doc/trunk/design/syn/S04.pod

Log:
Neglected to mention that unless also allows binding of its false parameter


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podTue Apr 17 11:26:03 2007
@@ -208,7 +208,8 @@
 within the closure you already know whether it evaluated to true
 or false.)  Binding within an Celse automatically binds the value
 tested by the previous Cif or Celsif, which, while known to be
-false, might nevertheless be an Iinteresting value of false.
+false, might nevertheless be an Iinteresting value of false.  (By similar
+reasoning, an Cunless allows binding of a false parameter.)
 
 Conditional statement modifiers work as in Perl 5.  So do the
 implicit conditionals implied by short-circuit operators.  Note though that


[svn:perl6-synopsis] r14378 - doc/trunk/design/syn

2007-04-24 Thread larry
Author: larry
Date: Tue Apr 24 16:49:21 2007
New Revision: 14378

Modified:
   doc/trunk/design/syn/S09.pod

Log:
cut-n-paste typo noticed by TheDamian++


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podTue Apr 24 16:49:21 2007
@@ -1063,13 +1063,13 @@
 subscripts that must match the same everywhere that parameter is used.
 For example,
 
-do - @wild { @b[[;] reverse @wild] = @a[[;] @wild]; };
+do - @wild { @b[[;] reverse @wild] = @a[[;] @wild] };
 
 produces an array with the dimensions reversed regardless of the
 dimensionality of C@a.  Since the multidimensional C@@wild notation
 is more or less equivalent to C[;[EMAIL PROTECTED], you can also write that 
as:
 
-do - @@wild { @b[reverse @@wild] = @a[[;] @@wild]; };
+do - @@wild { @b[reverse @@wild] = @a[@@wild] };
 
 The optimizer is, of course, free to optimize away any implicit loops
 that it can figure out how to do more efficiently without changing


[svn:perl6-synopsis] r14379 - doc/trunk/design/syn

2007-04-24 Thread larry
Author: larry
Date: Tue Apr 24 17:02:17 2007
New Revision: 14379

Modified:
   doc/trunk/design/syn/S13.pod

Log:
Clarification suggested by TheDamian++


Modified: doc/trunk/design/syn/S13.pod
==
--- doc/trunk/design/syn/S13.pod(original)
+++ doc/trunk/design/syn/S13.podTue Apr 24 17:02:17 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 2 Nov 2004
-  Last Modified: 17 Feb 2007
+  Last Modified: 24 Apr 2007
   Number: 13
-  Version: 7
+  Version: 8
 
 =head1 Overview
 
@@ -156,11 +156,26 @@
 method @.[ *@@slices ] {...}
 method %.{ *@@slices } {...}
 
-The actual sigil used doesn't matter as long as it's followed by a dot
-and the bracket pair containing the signature.  (Note that the angle
-bracket subscripting form C .a b c  automatically translates
-itself into a call to C .{'a','b','c'} , so defining methods for
-angles is basically useless.)
+The sigil-dot sequence in these short forms autogenerates the
+corresponding public operators, in exactly the same way that
+the sigil-dot in:
+
+has $.action;
+has @.sequence;
+has %.mapping;
+
+autogenerates public accessor methods.
+
+And because it uses the same method-autogeneration mechanism, the
+specific sigil used to specify a short-form postcircumfix operator
+doesn't actually matter...as long as it's followed by a dot and the
+bracket pair containing the signature. (Though it's probably kinder
+to future readers of your code to stick with the natural sigil
+for each type of bracket.)
+
+Note that the angle bracket subscripting form C .a b c 
+automatically translates itself into a call to C .{'a','b','c'} ,
+so defining methods for angles is basically useless.
 
 The expected semantics of C.() is that of a type coercion which may
 or may not create a new object.  So if you say:


[svn:perl6-synopsis] r14380 - doc/trunk/design/syn

2007-04-24 Thread larry
Author: larry
Date: Tue Apr 24 18:05:36 2007
New Revision: 14380

Modified:
   doc/trunk/design/syn/S10.pod

Log:
Clarifications to CANDO suggested by TheDamian++


Modified: doc/trunk/design/syn/S10.pod
==
--- doc/trunk/design/syn/S10.pod(original)
+++ doc/trunk/design/syn/S10.podTue Apr 24 18:05:36 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 6 Apr 2006
+  Last Modified: 24 Apr 2007
   Number: 10
-  Version: 6
+  Version: 7
 
 =head1 Overview
 
@@ -88,7 +88,7 @@
 that distinguish declaration from definition, but are not restricted
 to declaring subs.  A run-time declarator multisub is declared as:
 
-multi CANDO ( MyPackage, $type, $name; *%args -- Container)
+multi CANDO ( MyPackage, $type, $name, *%args -- Container)
 
 which stands in for the declaration of a container object within
 another container object; it is called when anyone is searching for
@@ -100,22 +100,34 @@
 name requested.  In any case, there may be multiple CCANDO routines
 that are dispatched via MMD:
 
-multi CANDO ( MyPackage, Item, $name; *%args -- Container)
-multi CANDO ( MyPackage, Array, $name; *%args -- Container)
-multi CANDO ( MyPackage, Hash, $name; *%args -- Container)
-multi CANDO ( MyPackage, Code, $name; *%args -- Container)
-
-The package itself is just passed as the
-first argument, since it's the container object.  Subsequent arguments
-identify the desired type of the inner container and the name or
-key by which the object is to be looked up in the outer container.
-Such a name does not include its container name, unlike Perl 5's magical
-C$AUTOLOAD variable.
-
-The CCANDO is expected to return an inner container object of the proper
-sort (i.e. a variable, subroutine, or method object), or to a proxy
-object that can autovivify lazily, or Cundef if that name is not to be
-considered declared in the namespace in question.
+multi CANDO ( MyPackage, Item, $name, *%args -- Container)
+multi CANDO ( MyPackage, Array, $name, *%args -- Container)
+multi CANDO ( MyPackage, Hash, $name, *%args -- Container)
+multi CANDO ( MyPackage, Code, $name, *%args -- Container)
+
+The package itself is just passed as the first argument, since it's
+the container object.  Subsequent arguments identify the desired type
+of the inner container and the name or key by which the object is
+to be looked up in the outer container.  Such a name does not include
+its container name, unlike Perl 5's magical C$AUTOLOAD variable.
+Nor does it include the type information of a Code object's long
+name; this information comes in via the type parameter, and may be
+matched against using ordinary subsignature matching:
+
+multi CANDO ( MyPackage, :($), $name, *%args -- Container) # 1 arg
+multi CANDO ( MyPackage, :($,$), $name, *%args -- Container)   # 2 args
+
+The slurpy C%args hash is likely to be empty in standard Perl 6
+usage, but it's possible that some dialects of Perl will desire
+a mechanism to pass in additional contextual information, so this
+parameter is reserved for such purposes.
+
+The CCANDO is expected to return an inner container object of
+the proper sort (i.e. a variable, subroutine, or method object),
+or a proxy object that can autovivify lazily, or Cundef if that
+name is not to be considered declared in the namespace in question.
+(Only bare Cundef is interpreted as not there, since typed undefs
+may function as autovivifiable proxy objects.  See S12.)
 
 The declaration merely defines the interface to the new object.  That object
 need not be completely defined yet, though the CCANDO routine is certainly
@@ -129,61 +141,12 @@
 When the package in question is a class, it is also possible to declare 
 real methods or submethods:
 
-multi method CANDO ($self: Code, $name; *%args -- Container)
+multi method CANDO ($self: Code, $name, *%args -- Container)
 
-multi submethod CANDO ($self: Item, $name; *%args -- Container)
+multi submethod CANDO ($self: Item, $name, *%args -- Container)
 
 The method form is inherited by subclasses.  Submethods are never
 inherited but may still do MMD within the class.   (Ordinary multisubs
 are inherited only to the extent allowed by the MMD mechanism.)
 
-=for DISCUSSION
-The following should really be in S12 if really works this way, but
-I'm not sure it does.  Seems like something is wrong, but I can't
-quite put my finger on it.  Something like, different containers want
-different default values, but we've probably lost track of the container.
-So anyway, the rest of this section is considered conjectural.
-
-When someone tries to actually call or access an undefined object
-(which may have come from one of the routines above, or might have just
-been declared with a body of C{...}), or might just be a variable
-declared without an initializer, a different hook is used

[svn:perl6-synopsis] r14381 - doc/trunk/design/syn

2007-04-24 Thread larry
Author: larry
Date: Tue Apr 24 18:29:02 2007
New Revision: 14381

Modified:
   doc/trunk/design/syn/S11.pod

Log:
Clarifications to module naming suggested by TheDamian++.


Modified: doc/trunk/design/syn/S11.pod
==
--- doc/trunk/design/syn/S11.pod(original)
+++ doc/trunk/design/syn/S11.podTue Apr 24 18:29:02 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 16 Apr 2007
+  Last Modified: 24 Apr 2007
   Number: 11
-  Version: 18
+  Version: 19
 
 =head1 Overview
 
@@ -44,9 +44,10 @@
 or use the sigil-like C::ModuleName syntax.  The C:: prefix does not
 imply top-levelness as it does in Perl 5.  (Use C::* or CGLOBAL:: for 
that.)
 
-A bare Cmodule declarator declares an Cour module name in the current
-package.  At the start of the file, the current package is C*, so the
-first declaration in the file is automatically global.
+A bare (unscoped) Cmodule declarator declares a nested Cour module
+name within the current package.  However, at the start of the file,
+the current package is C*, so the first such declaration in the
+file is automatically global.
 
 You can use Cour module to explicitly
 declare a module in the current package (or module, or class).
@@ -149,25 +150,33 @@
 
 =head1 Runtime Importation
 
-Importing via Crequire also binds into the current lexical scope by
-default, but performs the binding at runtime:
+Importing via Crequire also installs names into the current lexical scope by
+default, but delays the actual binding till runtime:
 
 require Sense common @horse;
 require /home/non/Sense.pm common @horse;
 
-Tagsets are not recognized in the default import list to C:MY, but you can
-explicitly request to put them into the C:OUR scope:
+Only explicitly mentioned names may be so installed.  In order
+to protect the run-time sanctity of the lexical pad, it may not be
+modified by Crequire.  Tagsets are assumed to be unknown at compile
+time, hence tagsets are not allowed in the default import list to
+C:MY, but you can explicitly request to put names into the C:OUR
+scope, since that is modifiable at run time:
 
 require Sense :ALL# does not work
 require Sense :MYALL  # this doesn't work either
 require Sense :OURALL # but this works
 
-If the import list is omitted, then nothing is imported.  Calling C.import
-at runtime cannot import into the lexical scope:
+If the import list is omitted, then nothing is imported.  Since you
+may not modify the lexical pad, calling an importation routine at
+runtime cannot import into the lexical scope, and defaults to importation
+to the package scope instead:
 
 require Sense;
 Sense.EXPORTALL;   # goes to the OUR scope by default, not MY
 
+(Such a routine Imay rebind existing lexicals, however.)
+
 =head1 Importing from a pseudo-package
 
 You may also import symbols from the various pseudo-packages listed in S02.
@@ -236,6 +245,24 @@
 
 class Dog:1.2.1 cpan:JRANDOM
 
+The pieces are interpreted as follows:
+=over
+
+=item *
+
+Anything matching C [ident '::']* ident  is treated as a
+package name
+
+=item *
+
+Anything matching C v? [\d+ '.']* \d+  is treated as a version number
+
+=item *
+
+Anything matching C alpha+ \: \S+  is treated as an author(ity)
+
+=back
+
 These declarations automatically alias the full name of the class
 (or module) to the short name.  So for the rest of the lexical scope,
 CDog refers to the longer name.  The real library name can be
@@ -286,7 +313,8 @@
 When specifying the version of your own module, C1.2 is equivalent
 to C1.2.0, C1.2.0.0, and so on.  However Cuse searches for
 modules matching a version prefix, so the subversions are wildcarded,
-and in this context C1.2 really means C1.2.*.  If you say:
+and in this context C :vers1.2  really means C :vers1.2.* .
+If you say:
 
 use v6;
 


[svn:perl6-synopsis] r14383 - doc/trunk/design/syn

2007-04-24 Thread larry
Author: larry
Date: Tue Apr 24 22:17:45 2007
New Revision: 14383

Modified:
   doc/trunk/design/syn/S12.pod

Log:
typos


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podTue Apr 24 22:17:45 2007
@@ -1144,9 +1144,9 @@
 
 proto method shake {...}
 
-(This declaration need not preceed the Cdoes clause textually, since
+(This declaration need not precede the Cdoes clause textually, since
 roles are not actually composed until the end of the class definition,
-at which point we know how which roles are to be composed together
+at which point we know which roles are to be composed together
 in a single logical operation, as well as how the class intends to
 override the roles.)
 


[svn:perl6-synopsis] r14384 - doc/trunk/design/syn

2007-04-26 Thread larry
Author: larry
Date: Thu Apr 26 18:47:39 2007
New Revision: 14384

Modified:
   doc/trunk/design/syn/S03.pod

Log:
Clarification of empty range semantics requested by coke++


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podThu Apr 26 18:47:39 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 13 Apr 2007
+  Last Modified: 26 Apr 2007
   Number: 3
-  Version: 113
+  Version: 114
 
 =head1 Overview
 
@@ -2148,6 +2148,9 @@
 
 @[EMAIL PROTECTED], @array[-1] xx *
 
+An empty Range cannot be iterated; it returns a CFailure instead.  An empty
+range still has a defined min and max, but the min is greater than the max.
+
 =item *
 
 The unary C^ operator generates a range from C0 up to


[svn:perl6-synopsis] r14385 - doc/trunk/design/syn

2007-04-27 Thread larry
Author: larry
Date: Fri Apr 27 08:46:01 2007
New Revision: 14385

Modified:
   doc/trunk/design/syn/S05.pod

Log:
Correction noted by bsb++


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Apr 27 08:46:01 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 17 Apr 2007
+   Last Modified: 27 Apr 2007
Number: 5
-   Version: 57
+   Version: 58
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -375,6 +375,8 @@
 match at all possible character positions (including overlapping)
 and return all matches in a list context, or a disjunction of matches
 in a scalar context.  The first match at any position is returned.
+The matches are guaranteed to be returned in left-to-right order with
+respect to the starting positions.
 
  $str = abracadabra;
 
@@ -384,13 +386,20 @@
 
 =item *
 
-With the new C:ex (C:exhaustive) modifier, the current regex will match
-every possible way (including overlapping) and return all matches in a list
-context, or a disjunction of matches in a scalar context.
+With the new C:ex (C:exhaustive) modifier, the current regex will
+match every possible way (including overlapping) and return all matches
+in a list context, or a disjunction of matches in a scalar context.
+The matches are guaranteed to be returned in left-to-right order with
+respect to the starting positions.  The order within each starting
+position is not guaranteed and may depend on the nature of both the
+pattern and the matching engine.  (Conjecture: or we could enforce
+backtracking engine semantics.  Or we could guarantee no order at all
+unless the pattern starts with :: or some such to suppress DFAish
+solutions.)
 
  $str = abracadabra;
 
- if $str ~~ m:exhaustive/ a (.*) a / {
+ if $str ~~ m:exhaustive/ a (.*?) a / {
  say @();# br brac bracad bracadabr c cad cadabr d dabr br
  }
 


[svn:perl6-synopsis] r14386 - doc/trunk/design/syn

2007-04-27 Thread larry
Author: larry
Date: Fri Apr 27 17:08:44 2007
New Revision: 14386

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S12.pod

Log:
more cleanup from TheDamian++
the ugly ::Animal initializers to .bless are gone; named args only bind params
sub-blesses are now just initialized using our new autovivifiable protoobjects
(.bless now allows those as positionals, in addition to the named args)
autovivifiable protoobjects now specified with Animal{ :foobar } notation


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Apr 27 17:08:44 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 12 Apr 2007
+  Last Modified: 27 Apr 2007
   Number: 2
-  Version: 101
+  Version: 102
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1457,6 +1457,10 @@
 GLOBAL::$IN   # Same as $*IN
 FooBar::Baz # same as Foo::Bar::Baz
 
+The final C:: is required here, because the CFoo::Bar{...} syntax
+is reserved for defining an autovivifiable protoobject along with
+it's initialization closure (see S12).
+
 Unlike C::() symbolic references, this does not parse the argument
 for C::, nor does it initiate a namespace scan from that initial
 point.  In addition, for constant subscripts, it is guaranteed to

Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podFri Apr 27 17:08:44 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 24 Apr 2007
+  Last Modified: 27 Apr 2007
   Number: 12
-  Version: 47
+  Version: 48
 
 =head1 Overview
 
@@ -121,16 +121,17 @@
 Every object (including any class object) delegates to an instance of
 its metaclass.  You can get at the metaclass of any object via the
 CHOW method.  A class object is just considered an empty
-instance in Perl 6, more properly called a prototype object.
+instance in Perl 6, more properly called a prototype object, or just
+protoobject.
 The actual class object is the metaclass object pointed to by the
-CHOW syntax.  So when you say Dog, you're referring to both a
-package and a prototype object, that latter of which points to the
-actual object representing the class via CHOW.  The prototype
-object differs from an instance object not by having a different
+CHOW syntax.  So when you say CDog, you're referring to both a
+package and a protoobject, that latter of which points to the
+actual object representing the class via CHOW.  The protoobject
+differs from an instance object not by having a different
 type but rather in the extent to which it is defined.  Some objects
 may tell you that they are defined, while others may tell you that
 they are undefined.  That's up to the object, and depends on how the
-metaclass chooses to dispatch the .defined method.
+metaclass chooses to dispatch the C.defined method.
 
 The notation C^Dog is syntactic sugar for CDog.HOW, so C^ can be
 considered the class sigil when you want to talk about the current
@@ -358,7 +359,7 @@
 Other OO languages give you the ability to declare class methods that either 
don't
 need or actively prohibit calls on instances.  Perl 6 gives you a choice.
 If you declare an ordinary method, it can function as a class method when you
-pass it a prototype object such as Dog regardless of how defined the 
prototype
+pass it a protoobject such as CDog regardless of how defined the prototype
 object is, as long as the method body doesn't try to access any information 
that
 is undefined in the current instance.
 
@@ -394,8 +395,9 @@
 
 Conjecture: in order to catch spelling errors it is a compile-time
 warning to define a submethod in any class that does not inherit the
-corresponding method name from some base class.  (But note that the
-standard CObject class supplies a default CBUILD and Cnew.)
+corresponding method name from some base class.  More importantly, this
+would help safeguard Liskov substitutability. (But note that the
+standard CObject class already supplies a default CBUILD and Cnew.)
 
 =head1 Attributes
 
@@ -538,8 +540,14 @@
 
 (The default CCREATE makes an opaque object.)
 
-All arguments to this form of Cbless must be named arguments, not
-positional.
+In addition to the candidate position argument, Cbless also
+allows one or more positional arguments representing autovivifying
+protoobjects.  Such an object looks like a prototype followed by a
+hash subscript (see Autovivifying objects below).  These are used
+to initialize superclasses.
+
+Other than the candidate object and any autovivifying protoobjects,
+all arguments to Cbless must be named arguments

[svn:perl6-synopsis] r14387 - doc/trunk/design/syn

2007-04-27 Thread larry
Author: larry
Date: Fri Apr 27 17:15:33 2007
New Revision: 14387

Modified:
   doc/trunk/design/syn/S02.pod

Log:
minor rewording


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Apr 27 17:15:33 2007
@@ -1457,8 +1457,8 @@
 GLOBAL::$IN   # Same as $*IN
 FooBar::Baz # same as Foo::Bar::Baz
 
-The final C:: is required here, because the CFoo::Bar{...} syntax
-is reserved for defining an autovivifiable protoobject along with
+The C:: before the subscript is required here, because the CFoo::Bar{...}
+syntax is reserved for defining an autovivifiable protoobject along with
 it's initialization closure (see S12).
 
 Unlike C::() symbolic references, this does not parse the argument


[svn:perl6-synopsis] r14388 - doc/trunk/design/syn

2007-04-27 Thread larry
Author: larry
Date: Fri Apr 27 17:23:07 2007
New Revision: 14388

Modified:
   doc/trunk/design/syn/S02.pod

Log:
apostropheo from masoch++


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Apr 27 17:23:07 2007
@@ -1459,7 +1459,7 @@
 
 The C:: before the subscript is required here, because the CFoo::Bar{...}
 syntax is reserved for defining an autovivifiable protoobject along with
-it's initialization closure (see S12).
+its initialization closure (see S12).
 
 Unlike C::() symbolic references, this does not parse the argument
 for C::, nor does it initiate a namespace scan from that initial


[svn:perl6-synopsis] r14389 - doc/trunk/design/syn

2007-04-28 Thread larry
Author: larry
Date: Sat Apr 28 15:23:15 2007
New Revision: 14389

Modified:
   doc/trunk/design/syn/S12.pod

Log:
Use of protoobjects for role initial values.


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podSat Apr 28 15:23:15 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 27 Apr 2007
+  Last Modified: 28 Apr 2007
   Number: 12
-  Version: 48
+  Version: 49
 
 =head1 Overview
 
@@ -1898,17 +1898,32 @@
 
 Dog{ :nameFido }
 
-This is still lazily evaluated:
+This form is also lazily evaluated:
 
 my $dog = Dog{ :nameFido };
 defined $dog or say doesn't exist;  # Fido doesn't exist
 $dog.wag()# Fido wags his tail
 
-Note that when used as an argument to a method like Cbless, the
-protoobject is sufficiently lazy that autovivifying is done only by
-the appropriate CBUILD routine.  It does not waste energy creating
-a CDog object when that object's attributes would later have to be
-copied into the actual object.
+When the typename happens to be a role, autovivifying it involves
+attempting to create a punned class of the same name as the role.
+Whether this succeeds or not depends on whether the role is
+sufficiently complete to serve as a class on its own.  Regardless of
+whether such an attempt would succeed, it is always perfectly fine to
+define a lazy protoobject for a role just as long as it's only ever
+used as an argument to Cbless, since Cbless will only be using
+its closure to construct the role's CBUILD arguments in the context
+of the complete new class.  (Of course, an inconsistent or incomplete
+class composition may subsequently fail, and in fact the incomplete
+role autovivification mentioned above is likely to be implemented by
+failing at the point of class composition.)
+
+Note that when used as an argument to a method like Cbless,
+the protoobject is sufficiently lazy that autovivifying is done
+only by the appropriate CBUILD routine.  It does not waste energy
+creating a CDog object when that object's attributes would later
+have to be copied into the actual object.  (On top of which, such
+an implementation would make it impossible to use protoobjects to
+initialize incomplete roles.)
 
 The object autovivification syntax works only for literal named types,
 so any indirection must be written more explicitly:


[svn:perl6-synopsis] r14390 - doc/trunk/design/syn

2007-05-14 Thread larry
Author: larry
Date: Mon May 14 10:13:16 2007
New Revision: 14390

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S06.pod
   doc/trunk/design/syn/S12.pod

Log:
coercion type renamed from returns to as to avoid confusion with of type.
ambiguity in block-end parsing noted by rhr++


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon May 14 10:13:16 2007
@@ -822,19 +822,19 @@
 
 In either case this sets the Cof property of the container to CDog.
 
-Subroutines have a variant of the Cof property, Creturns, that sets
-the Creturns property instead.  The Creturns property specifies a
+Subroutines have a variant of the Cof property, Cas, that sets
+the Cas property instead.  The Cas property specifies a
 constraint (or perhaps coercion) to be enforced on the return value (either
 by explicit call to Creturn or by implicit fall-off-the-end return).
 This constraint, unlike the Cof property, is not advertised as the
 type of the routine.  You can think of it as the implicit type signature of
 the (possibly implicit) return statement.  It's therefore available for
-type inferencing within the routine but not outside it.  If no inner type
+type inferencing within the routine but not outside it.  If no Cas type
 is declared, it is assumed to be the same as the Cof type, if declared.
 
 sub get_pet() of Animal {...}   # of type, obviously
 our Animal sub get_pet() {...}  # of type
-sub get_pet() returns Animal {...}  # inner type
+sub get_pet() as Animal {...}   # as type
 
 A value type on an array or hash specifies the type stored by each element:
 
@@ -892,18 +892,19 @@
 my Hash of Array of Recipe %book;   # HoHoAoRecipe
 my %book of Hash of Array of Recipe;# same thing
 
-The Creturns form may be used in subroutines:
+The Cas form may be used in subroutines:
 
-my sub get_book ($key) returns Hash of Array of Recipe {...}
+my sub get_book ($key) as Hash of Array of Recipe {...}
 
 Alternately, the return type may be specified within the signature:
 
 my sub get_book ($key -- Hash of Array of Recipe) {...}
 
 There is a slight difference, insofar as the type inferencer will
-ignore a Creturns but pay attention to C --  or prefix type
+ignore a Cas but pay attention to C --  or prefix type
 declarations, also known as the Cof type.  Only the inside of the
-subroutine pays attention to Creturns.
+subroutine pays attention to Cas, and essentially coerces the return
+value to the indicated type, just as if you'd coerced each return expression.
 
 You may also specify the Cof type as the Cof trait:
 
@@ -963,18 +964,18 @@
 
 On a scoped subroutine, a return type can be specified before or after
 the name.  We call all return types return types, but distinguish
-two kinds of return types, the Cinner type and the Cof type,
+two kinds of return types, the Cas type and the Cof type,
 because the Cof type is normally an official named type and
-declares the official interface to the routine, while the Cinner
+declares the official interface to the routine, while the Cas
 type is merely a constraint on what may be returned by the routine
 from the routine's point of view.
 
-our sub lay returns Egg {...}   # inner type
+our sub lay as Egg {...}# as type
 our Egg sub lay {...}   # of type
 our sub lay of Egg {...}# of type
 our sub lay (-- Egg) {...} # of type
 
-my sub hat returns Rabbit {...} # inner type
+my sub hat as Rabbit {...}  # as type
 my Rabbit sub hat {...} # of type
 my sub hat of Rabbit {...}  # of type
 my sub hat (-- Rabbit) {...}   # of type
@@ -983,14 +984,14 @@
 namespace (module, class, grammar, or package), as if it's scoped with
 the Cour scope modifier. Any return type must go after the name:
 
-sub lay returns Egg {...}   # inner type
+sub lay as Egg {...}# as type
 sub lay of Egg {...}# of type
 sub lay (-- Egg) {...} # of type
 
 On an anonymous subroutine, any return type can only go after the Csub
 keyword:
 
-$lay = sub returns Egg {...};   # inner type
+$lay = sub as Egg {...};# as type
 $lay = sub of Egg {...};# of type
 $lay = sub (-- Egg) {...}; # of type
 
@@ -1003,14 +1004,14 @@
 without affecting the meaning.
 
 The return type may also be specified after a C --  token within
-the signature.  This doesn't mean exactly the same thing as Creturns.
+the signature.  This doesn't mean exactly the same thing as Cas.
 The Cof type is the official return type, and may therefore be
-used to do type inferencing outside the sub.  The Cinner type only
+used to do type inferencing outside the sub.  The Cas type only
 makes

[svn:perl6-synopsis] r14391 - doc/trunk/design/syn

2007-05-16 Thread larry
Author: larry
Date: Wed May 16 12:36:05 2007
New Revision: 14391

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S05.pod
   doc/trunk/design/syn/S12.pod

Log:
Now allow returns as synonym for of (TheDamian++)
Reconcile S05's view of Array smartmatch with S03's view


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed May 16 12:36:05 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 27 Apr 2007
+  Last Modified: 16 May 2007
   Number: 2
-  Version: 102
+  Version: 103
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -813,6 +813,7 @@
 container has an implementation type, including subroutines and modules.)
 The value type is stored as its Cof property, while the implementation
 type of the container is just the object type of the container itself.
+The word Creturns is allowed as an alias for Cof.
 
 The value type specifies what kinds of values may be stored in the
 variable. A value type is given as a prefix or with the Cof keyword:
@@ -833,6 +834,7 @@
 is declared, it is assumed to be the same as the Cof type, if declared.
 
 sub get_pet() of Animal {...}   # of type, obviously
+sub get_pet() returns Animal {...}  # of type
 our Animal sub get_pet() {...}  # of type
 sub get_pet() as Animal {...}   # as type
 
@@ -906,10 +908,12 @@
 subroutine pays attention to Cas, and essentially coerces the return
 value to the indicated type, just as if you'd coerced each return expression.
 
-You may also specify the Cof type as the Cof trait:
+You may also specify the Cof type as the Cof trait (with Creturns
+allowed as a synonym):
 
 my Hash of Array of Recipe sub get_book ($key) {...}
 my sub get_book ($key) of Hash of Array of Recipe {...}
+my sub get_book ($key) returns Hash of Array of Recipe {...}
 
 =head2 Polymorphic types
 

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podWed May 16 12:36:05 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 27 Apr 2007
+   Last Modified: 16 May 2007
Number: 5
-   Version: 58
+   Version: 59
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -3426,9 +3426,11 @@
 =item *
 
 Any non-compact array of mixed strings or objects can be matched
-against a regex:
+against a regex as long as you present them as an object with the CStr
+interface, which does not preclude the object having other interfaces
+such as CArray.  Normally you'd use Ccat to generate such an object:
 
-@array ~~ / foo , bar elem* /;
+@array.cat ~~ / foo , bar elem* /;
 
 The special C ,  subrule matches the boundary between elements.
 The C elem  assertion matches any individual array element.
@@ -3437,9 +3439,9 @@
 If the array elements are strings, they are concatenated virtually into
 a single logical string.  If the array elements are tokens or other
 such objects, the objects must provide appropriate methods for the
-kinds of subrules to match against.  It is an assertion error to match
+kinds of subrules to match against.  It is an assertion failure to match
 a string-matching assertion against an object that doesn't provide
-a string view.  However, pure object lists can be parsed as long as
+a stringified view.  However, pure object lists can be parsed as long as
 the match (including any subrules) restricts itself to assertions like:
 
  .isa(Dog)
@@ -3448,7 +3450,9 @@
 
 It is permissible to mix objects and strings in an array as long as they're
 in different elements.  You may not embed objects in strings, however.
-Any object may, of course, pretend to be a string element if it likes.
+Any object may, of course, pretend to be a string element if it likes,
+and so a CCat object may be used as a substring with the same restrictions
+as in the main string.
 
 Please be aware that the warnings on C.from and C.to returning
 opaque objects goes double for matching against an array, where a
@@ -3456,13 +3460,21 @@
 (potentially) a position within a string of that array.  Do not
 expect to do math with such values.  Nor should you expect to be
 able to extract a substr that crosses element boundaries.
+[Conjecture: Or should you?]
 
 =item *
 
-To match against each element of an array, use a hyper operator:
+To match against every element of an array, use a hyper operator:
 
  @array».match($regex);
 
+=item *
+
+To match against any element of the array, it suffices

[svn:perl6-synopsis] r14393 - doc/trunk/design/syn

2007-05-18 Thread larry
Author: larry
Date: Fri May 18 10:41:09 2007
New Revision: 14393

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Shouldn't generally define immutable types in terms of mutable ones.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri May 18 10:41:09 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 16 May 2007
+  Last Modified: 18 May 2007
   Number: 2
-  Version: 103
+  Version: 104
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -738,8 +738,8 @@
 ListLazy Perl list (composed of Seq and Range parts)
 Seq Completely evaluated (hence immutable) sequence
 Range   A pair of Ordered endpoints; gens lazy Seq in list context
-Set Unordered Seq that allows no duplicates (does KeyHash, but ro)
-Bag Unordered Seq that allows duplicates (does KeyHash, but ro)
+Set Unordered Seq that allows no duplicates
+Bag Unordered Seq that allows duplicates
 JunctionSets with additional behaviours
 PairSeq of two elements that serves as a one-element Mapping
 Mapping Pairs with no duplicate keys


[svn:perl6-synopsis] r14394 - doc/trunk/design/syn

2007-05-19 Thread larry
Author: larry
Date: Sat May 19 09:06:10 2007
New Revision: 14394

Modified:
   doc/trunk/design/syn/S12.pod

Log:
basal was not intuitive, changed to super
use optimize is too long and not specific enough
now turn on class closing and finalization with use oo :closed :final


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podSat May 19 09:06:10 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 14 May 2007
+  Last Modified: 19 May 2007
   Number: 12
-  Version: 50
+  Version: 51
 
 =head1 Overview
 
@@ -1649,9 +1649,10 @@
 
 =head1 Open vs Closed Classes
 
-By default, all classes in Perl are non-final, which means you can derive
-from them.  They are also open, which means you can add more methods
-to them, though you have to be explicit that that is what you're doing:
+By default, all classes in Perl are non-final (super), which means
+you can potentially derive from them.  They are also open, which means
+you can add more methods to them, though you have to be explicit that
+that is what you're doing:
 
 class Object is also {
 method wow () { say Wow, I'm an object. }
@@ -1662,24 +1663,25 @@
 don't do that.)
 
 For optimization purposes, Perl 6 gives the top-level application the
-right to close and finalize classes.
+right to close and finalize classes by the use of Coo, a pragma for
+selecting global semantics of the underlying object-oriented engine:
 
-use optimize :classesclose finalize;
+use oo :closed :final;
 
 This merely changes the application's default to closed and final,
 which means that at the end of the main compilation (CCHECK time)
 the optimizer is allowed to look for candidate classes to close or
 finalize.  But anyone (including the main application) can request
-that any class stay open or basal, and the class closer/finalizer
+that any class stay open or super, and the class closer/finalizer
 must honor that.
 
-use class :openMammal Insect :basalStr
+use class :openMammal Insect :superStr
 
 These properties may also be specified on the class definition:
 
 class Mammal is open {...}
 class Insect is open {...}
-class Str is basal {...}
+class Str is super {...}
 
 or by lexically scoped pragma around the class definition:
 
@@ -1689,7 +1691,7 @@
 class Insect {...}
 }
 {
-use class :basal;
+use class :super;
 class Str {...}
 }
 


[svn:perl6-synopsis] r14395 - doc/trunk/design/syn

2007-05-19 Thread larry
Author: larry
Date: Sat May 19 09:45:24 2007
New Revision: 14395

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Clarify type semantics of sigil bindability, requested by dduncan++.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podSat May 19 09:45:24 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 18 May 2007
+  Last Modified: 19 May 2007
   Number: 2
-  Version: 104
+  Version: 105
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1080,6 +1080,20 @@
 
 =item *
 
+Sigils indicate overall interface, not the exact type of the bound
+object.  Hence, C@x may be bound to an object of the CArray
+class, but it may also be bound to any object that does the CArray
+role, such as a CList, CSeq, CRange, CSet, CBag, CBuf,
+CCapture, and so on.  Likewise, C%x may be bound to a CPair,
+CMapping, CSet, CBag, CKeyHash, CCapture, and so on.
+And Cx may be bound to any kind of CBlock or CRoutine.
+The implicit container type is checked at binding time.  If you wish
+to bind an object that doesn't yet do the appropriate role, you must
+either stick with the generic C$ sigil, or mix in the appropriate
+role before binding to a more specific sigil.
+
+=item *
+
 Unlike in Perl 5, you may no longer put whitespace between a sigil
 and its following name or construct.
 


[svn:perl6-synopsis] r14396 - doc/trunk/design/syn

2007-05-19 Thread larry
Author: larry
Date: Sat May 19 16:13:45 2007
New Revision: 14396

Modified:
   doc/trunk/design/syn/S11.pod

Log:
format bug noticed by renormalist++


Modified: doc/trunk/design/syn/S11.pod
==
--- doc/trunk/design/syn/S11.pod(original)
+++ doc/trunk/design/syn/S11.podSat May 19 16:13:45 2007
@@ -246,6 +246,7 @@
 class Dog:1.2.1 cpan:JRANDOM
 
 The pieces are interpreted as follows:
+
 =over
 
 =item *


[svn:perl6-synopsis] r14397 - doc/trunk/design/syn

2007-05-21 Thread larry
Author: larry
Date: Mon May 21 07:57:22 2007
New Revision: 14397

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Some clarifications of type definitions


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon May 21 07:57:22 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 19 May 2007
+  Last Modified: 21 May 2007
   Number: 2
-  Version: 105
+  Version: 106
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -735,14 +735,14 @@
 Exception   Perl exception
 CodeBase class for all executable objects
 Block   Executable objects that have lexical scopes
-ListLazy Perl list (composed of Seq and Range parts)
+ListLazy Perl list (composed of immutables and iterators)
 Seq Completely evaluated (hence immutable) sequence
-Range   A pair of Ordered endpoints; gens lazy Seq in list context
-Set Unordered Seq that allows no duplicates
-Bag Unordered Seq that allows duplicates
-JunctionSets with additional behaviours
-PairSeq of two elements that serves as a one-element Mapping
-Mapping Pairs with no duplicate keys
+Range   A pair of Ordered endpoints; gens immutables when iterated
+Set Unordered values that allow no duplicates
+Bag Unordered values that allow duplicates
+JunctionSets with additional behaviors
+PairTwo elements that serve as key/value in a one-element Mapping
+Mapping Pair set with no duplicate keys
 Signature   Function parameters (left-hand side of a binding)
 Capture Function call arguments (right-hand side of a binding)
 BlobAn undifferentiated mass of bits
@@ -750,7 +750,8 @@
 =head2 Mutable types
 
 Objects with these types have distinct C.WHICH values that do not change
-even if the object's contents change.
+even if the object's contents change.  (Routines are considered mutable
+because they can be wrapped in place.)
 
 Scalar  Perl scalar
 Array   Perl array


[svn:perl6-synopsis] r14398 - doc/trunk/design/syn

2007-05-21 Thread larry
Author: larry
Date: Mon May 21 08:22:06 2007
New Revision: 14398

Modified:
   doc/trunk/design/syn/S12.pod

Log:
Dehuffmanized super to nonfinal for clarity and parsimony.


Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podMon May 21 08:22:06 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 27 Oct 2004
-  Last Modified: 19 May 2007
+  Last Modified: 21 May 2007
   Number: 12
-  Version: 51
+  Version: 52
 
 =head1 Overview
 
@@ -1649,7 +1649,7 @@
 
 =head1 Open vs Closed Classes
 
-By default, all classes in Perl are non-final (super), which means
+By default, all classes in Perl are non-final, which means
 you can potentially derive from them.  They are also open, which means
 you can add more methods to them, though you have to be explicit that
 that is what you're doing:
@@ -1672,16 +1672,16 @@
 which means that at the end of the main compilation (CCHECK time)
 the optimizer is allowed to look for candidate classes to close or
 finalize.  But anyone (including the main application) can request
-that any class stay open or super, and the class closer/finalizer
+that any class stay open or nonfinal, and the class closer/finalizer
 must honor that.
 
-use class :openMammal Insect :superStr
+use class :openMammal Insect :nonfinalStr
 
 These properties may also be specified on the class definition:
 
 class Mammal is open {...}
 class Insect is open {...}
-class Str is super {...}
+class Str is nonfinal {...}
 
 or by lexically scoped pragma around the class definition:
 
@@ -1691,7 +1691,7 @@
 class Insect {...}
 }
 {
-use class :super;
+use class :nonfinal;
 class Str {...}
 }
 


[svn:perl6-synopsis] r14399 - doc/trunk/design/syn

2007-05-21 Thread larry
Author: larry
Date: Mon May 21 11:46:23 2007
New Revision: 14399

Modified:
   doc/trunk/design/syn/S02.pod

Log:
clarification suggested by Ruud++


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon May 21 11:46:23 2007
@@ -738,8 +738,8 @@
 ListLazy Perl list (composed of immutables and iterators)
 Seq Completely evaluated (hence immutable) sequence
 Range   A pair of Ordered endpoints; gens immutables when iterated
-Set Unordered values that allow no duplicates
-Bag Unordered values that allow duplicates
+Set Unordered group of values that allows no duplicates
+Bag Unordered group of values that allows duplicates
 JunctionSets with additional behaviors
 PairTwo elements that serve as key/value in a one-element Mapping
 Mapping Pair set with no duplicate keys


[svn:perl6-synopsis] r14400 - doc/trunk/design/syn

2007-05-21 Thread larry
Author: larry
Date: Mon May 21 16:29:46 2007
New Revision: 14400

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S06.pod

Log:
Keep syntactic categories in sync with Perl-6.0.0-STD.pm


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon May 21 16:29:46 2007
@@ -14,7 +14,7 @@
   Date: 10 Aug 2004
   Last Modified: 21 May 2007
   Number: 2
-  Version: 106
+  Version: 107
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -2954,33 +2954,46 @@
 
 Here are the current grammatical categories:
 
-term:...  $x = {...}
-quote:qX  qX/foo/
-prefix:!  !$x (and $x.'!')
-infix:+   $x + $y
-postfix:++$x++
+category:prefix   prefix:+
 circumfix:[ ] [ @x ]
+dotty:.=  $obj.=method
+infix_circumfix_meta_operator:{'»','«'} @a »+« @b
+infix_postfix_meta_operator:= $x += 2;
+infix_prefix_meta_operator:!  $x !~~ 2;
+infix:+   $x + $y
+package_declarator:role   role Foo;
 postcircumfix:[ ] $x[$y] or $x.[$y]
-regex_metachar:,  /,/
+postfix_prefix_meta_operator:{'»'}  @array »++
+postfix:++$x++
+prefix_circumfix_meta_operator:{'[',']'}[*]
+prefix_postfix_meta_operator:{'«'}  -« @magnitudes
+prefix:!  !$x (and $x.'!')
+q_backslash:\\'\\'
+qq_backslash:n\n
+quote_mod:x   q:x/ ls /
+quote:qq  qq/foo/
+regex_assertion:! /!before \h/
 regex_backslash:w /\w/ and /\W/
-regex_assertion:* /*stuff/
-regex_mod_internal:perl5  m:/ ... :perl5 ... /
-regex_mod_external:nthm:nth(3)/ ... /
-trait_verb:handleshas $.tail handles wag
-trait_auxiliary:shall my $x shall conformTR123
+regex_metachar:.  /.*/
+regex_mod_internal:P5 m:/ ... :P5 ... /
+routine_declarator:subsub foo {...}
 scope_declarator:has  has $.x;
+sigil:%   %hash
+special_variable:$!   $!
+statement_control:if  if $condition { 1 } else { 2 }
+statement_mod_cond:if .say if $condition
+statement_mod_loop:for.say for 1..10
 statement_prefix:gather   gather for @foo { .take }
-statement_control:if  if $condition {...} else {...}
-statement_mod_cond:if ... if $condition
-statement_mod_loop:for... for 1..10
-infix_prefix_meta_operator:!  $x !~~ 2;
-infix_postfix_meta_operator:= $x += 2;
-postfix_prefix_meta_operator:{'»'}  @array »++
-prefix_postfix_meta_operator:{'«'}  -« @magnitudes
-infix_circumfix_meta_operator:{'»','«'} @a »+« @b
-prefix_circumfix_meta_operator:{'[',']'}[*]
+term:!!!  $x = { !!! }
+trait_auxiliary:does  my $x does Freezable
+trait_verb:handleshas $.tail handles wag
+twigil:?  $?LINE
+type_declarator:subsetsubset Nybble of Int where ^16
+version:v v4.3.*
 
 Any category containing circumfix requires two token arguments, supplied
-in slice notation.
+in slice notation.  Note that many of these names do not represent real
+operators, and you wouldn't be able to call them even though you can name
+them.
 
 =for vim:set expandtab sw=4:

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podMon May 21 16:29:46 2007
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 14 May 2007
+  Last Modified: 21 May 2007
   Number: 6
-  Version: 83
+  Version: 84
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the
@@ -1493,30 +1493,42 @@
 or associativity because they are parsed specially

[svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-23 Thread larry
Author: larry
Date: Wed May 23 11:11:34 2007
New Revision: 14401

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Clarifications suggested by Jonathan Lang++ and spinclad++.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podWed May 23 11:11:34 2007
@@ -738,11 +738,11 @@
 ListLazy Perl list (composed of immutables and iterators)
 Seq Completely evaluated (hence immutable) sequence
 Range   A pair of Ordered endpoints; gens immutables when iterated
-Set Unordered group of values that allows no duplicates
-Bag Unordered group of values that allows duplicates
-JunctionSets with additional behaviors
-PairTwo elements that serve as key/value in a one-element Mapping
-Mapping Pair set with no duplicate keys
+Set Unordered collection of values that allows no duplicates
+Bag Unordered collection of values that allows duplicates
+JunctionSet with additional behaviors
+PairA single key-to-value association
+Mapping Set of Pairs with no duplicate keys
 Signature   Function parameters (left-hand side of a binding)
 Capture Function call arguments (right-hand side of a binding)
 BlobAn undifferentiated mass of bits
@@ -1053,7 +1053,7 @@
 Perl 6 includes a system of Bsigils to mark the fundamental
 structural type of a variable:
 
-$   scalar
+$   scalar (object)
 @   ordered array
 %   unordered hash (associative array)
code/rule/token/regex
@@ -1082,16 +1082,54 @@
 =item *
 
 Sigils indicate overall interface, not the exact type of the bound
-object.  Hence, C@x may be bound to an object of the CArray
-class, but it may also be bound to any object that does the CArray
-role, such as a CList, CSeq, CRange, CSet, CBag, CBuf,
-CCapture, and so on.  Likewise, C%x may be bound to a CPair,
-CMapping, CSet, CBag, CKeyHash, CCapture, and so on.
-And Cx may be bound to any kind of CBlock or CRoutine.
-The implicit container type is checked at binding time.  If you wish
-to bind an object that doesn't yet do the appropriate role, you must
-either stick with the generic C$ sigil, or mix in the appropriate
-role before binding to a more specific sigil.
+object.  Different sigils imply different minimal abilities.
+
+C$x may be bound to any object, including any object that can be
+bound to any other sigil.  Such a scalar variable is always treated as
+a singular item in any kind of list context, regardless of whether the
+object is essentially composite or unitary.  It will not automatically
+dereference to its contents unless placed explicitly in some kind of
+dereferencing context.  In particular, when interpolating into list
+context, C$x never expands its object to anything other than the
+object itself as a single item, even if the object is a container
+object containing multiple items.
+
+C@x may be bound to an object of the CArray class, but it may also
+be bound to any object that does the CPositional role, such as a
+CList, CSeq, CRange, CBuf, or CCapture.  The CPositional
+role implies the ability to support C postcircumfix:[ ] .
+
+Likewise, C%x may be bound to any object that does the CAssociative
+role, such as CPair, CMapping, CSet, CBag, CKeyHash, or
+CCapture.  The CAssociative role implies the ability to support
+C postcircumfix:{ } .
+
+Cx may be bound to any object that does the CCallable role, such
+as any CBlock or CRoutine.  The CCallable role implies the ability
+to support C postcircumfix:( ) .
+
+C::x may be bound to any object that does the CAbstraction role,
+such as a typename, package, module, class, role, grammar, or any other
+protoobject with C.HOW hooks.  This CAbstraction role implies the
+ability to do various symbol table and/or typological manipulations which
+may or may not be supported by any given abstraction.  Mostly though it
+just means that you want to give some abstraction an official name that
+you can then use later in the compilation without any sigil.
+
+In any case, the minimal container role implied by the sigil is
+checked at binding time at the latest, and may fail earlier (such
+as at compile time) if a semantic error can be detected sooner.
+If you wish to bind an object that doesn't yet do the appropriate
+role, you must either stick with the generic C$ sigil, or mix in
+the appropriate role before binding to a more specific sigil.
+
+An object is allowed to support both CPositional and CAssociative.
+An object that does not support CPositional may not be bound directly
+to C@x.  However, any construct such as C%x that can interpolate
+the contents of such an object into list context can automatically
+construct a list value that may then be bound to an array variable.
+Subscripting such a list does not imply subscripting back

[svn:perl6-synopsis] r14402 - doc/trunk/design/syn

2007-05-28 Thread larry
Author: larry
Date: Mon May 28 12:14:12 2007
New Revision: 14402

Modified:
   doc/trunk/design/syn/S04.pod

Log:
Clarifications to conditional bindings suggested by xinming++ and gaal++.


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podMon May 28 12:14:12 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 17 Apr 2007
+  Last Modified: 28 May 2007
   Number: 4
-  Version: 57
+  Version: 58
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -211,6 +211,24 @@
 false, might nevertheless be an Iinteresting value of false.  (By similar
 reasoning, an Cunless allows binding of a false parameter.)
 
+An explicit placeholder may also be used:
+
+if blahblah() { return $^it }
+
+However, use of C$_ with a conditional statement's block is Inot
+considered sufficiently explicit to turn a 0-ary block into a 1-ary
+function, so both these methods use the same invocant:
+
+if .haste { .waste }
+
+(Contrast with a non-conditional statement such as:
+
+for .haste { .waste }
+
+where each call to the block would bind a new invocant for the
+C.waste method, each of which is likely different from the original
+invocant to the C.hast method.)
+
 Conditional statement modifiers work as in Perl 5.  So do the
 implicit conditionals implied by short-circuit operators.  Note though that
 the first expression within parens or brackets is parsed as a statement,
@@ -253,13 +271,15 @@
 ...
 }
 
-You may optionally bind the result of the conditional expression to a
-parameter of the block:
+As with conditionals, you may optionally bind the result of the
+conditional expression to a parameter of the block:
 
 while something() - $thing {
 ...
 }
 
+while something() - { ... $^thing ... }
+
 Nothing is ever bound implicitly, however, and many conditionals would
 simply bind True or False in an uninteresting fashion.  This mechanism
 is really only good for objects that know how to return a boolean
@@ -491,6 +511,18 @@
 explicit because it's not out front where it can be seen.  You can, of
 course, use a placeholder parameter if you also use Creturn.)
 
+Another consequence of this is that any block just inside a
+left parenthesis is immediately called like a bare block, so a
+multidimensional list comprehension may be written using a block with
+multiple parameters fed by a Cfor modifier:
+
+@names = (- $name, $num { $name.$num } for 'a'..'zzz' X 1..100);
+
+or equivalently, using placeholders:
+
+@names = ({ $^name.$^num } for 'a'..'zzz' X 1..100);
+
+
 =head2 The gather statement
 
 A variant of Cdo is Cgather.  Like Cdo, it is followed by a


[svn:perl6-synopsis] r14403 - doc/trunk/design/syn

2007-05-28 Thread larry
Author: larry
Date: Mon May 28 13:53:39 2007
New Revision: 14403

Modified:
   doc/trunk/design/syn/S04.pod

Log:
typo noticed by (John Macdonald and Bob Rogers)++


Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podMon May 28 13:53:39 2007
@@ -227,7 +227,7 @@
 
 where each call to the block would bind a new invocant for the
 C.waste method, each of which is likely different from the original
-invocant to the C.hast method.)
+invocant to the C.haste method.)
 
 Conditional statement modifiers work as in Perl 5.  So do the
 implicit conditionals implied by short-circuit operators.  Note though that


<    1   2   3   4   5   6   7   8   9   10   >