Author: lwall Date: 2010-05-21 09:15:36 +0200 (Fri, 21 May 2010) New Revision: 30742
Modified: docs/Perl6/Spec/S02-bits.pod docs/Perl6/Spec/S03-operators.pod docs/Perl6/Spec/S06-routines.pod docs/Perl6/Spec/S12-objects.pod Log: [Spec] :() is now always signature. Use foofix:[...] as the general op form Modified: docs/Perl6/Spec/S02-bits.pod =================================================================== --- docs/Perl6/Spec/S02-bits.pod 2010-05-21 06:55:13 UTC (rev 30741) +++ docs/Perl6/Spec/S02-bits.pod 2010-05-21 07:15:36 UTC (rev 30742) @@ -13,8 +13,8 @@ Created: 10 Aug 2004 - Last Modified: 8 May 2010 - Version: 215 + Last Modified: 21 May 2010 + Version: 216 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -2996,14 +2996,14 @@ infix:<+> infix:<<+>> infix:«+» - infix:('+') + infix:['+'] Despite the appearance as a subscripting form, these names are resolved not at run time but at compile time. The pseudo-subscripts need not be simple scalars. These are extended with the same two-element list: infix:<?? !!> - infix:('??','!!') + infix:['??','!!'] An identifier may be extended with multiple named identifier extensions, in which case the names matter but their order does not. @@ -3359,11 +3359,11 @@ 8 => <123> :8<123> radix literal 0o123 16 => <deadbeef> :16<deadbeef> radix literal 0xdeadbeef 16 => $somevalue :16($somevalue) radix conversion function - '' => $x :($x) arglist or signature literal - '' => ($x,$y) :($x,$y) arglist or signature literal + '' => $x :($x) signature literal + '' => ($x,$y) :($x,$y) signature literal '' => <x> :<x> name extension '' => «x» :«x» name extension - '' => ($x,$y) :($x,$y) name extension + '' => [$x,$y] :[$x,$y] name extension '' => { .say } :{ .say } adverbial block (not allowed on names) All of the adverbial forms (including the normal ones with Modified: docs/Perl6/Spec/S03-operators.pod =================================================================== --- docs/Perl6/Spec/S03-operators.pod 2010-05-21 06:55:13 UTC (rev 30741) +++ docs/Perl6/Spec/S03-operators.pod 2010-05-21 07:15:36 UTC (rev 30742) @@ -15,8 +15,8 @@ Created: 8 Mar 2004 - Last Modified: 16 May 2010 - Version: 204 + Last Modified: 21 May 2010 + Version: 205 =head1 Overview @@ -796,7 +796,7 @@ =item * -C<< infix:('+&') >>, numeric bitwise and +C<< infix:['+&'] >>, numeric bitwise and $x +& $y @@ -805,13 +805,13 @@ =item * -C<< infix:('+<') >>, numeric shift left +C<< infix:['+<'] >>, numeric shift left $integer +< $bits =item * -C<< infix:('+>') >>, numeric shift right +C<< infix:['+>'] >>, numeric shift right $integer +> $bits @@ -836,13 +836,13 @@ =item * -C<< infix:('~<') >>, buffer bitwise shift left +C<< infix:['~<'] >>, buffer bitwise shift left $buf ~< $bits =item * -C<< infix:('~>') >>, buffer bitwise shift right +C<< infix:['~>'] >>, buffer bitwise shift right $buf ~> $bits @@ -1573,7 +1573,7 @@ =item * -C<< infix:('=>') >>, Pair constructor +C<< infix:['=>'] >>, Pair constructor foo => 1, bar => "baz" @@ -2540,7 +2540,7 @@ =item * C<< -> >> becomes C<.>, like the rest of the world uses. There is -a pseudo C<< postfix:('->') >> operator that produces a compile-time +a pseudo C<< postfix:['->'] >> operator that produces a compile-time error reminding Perl 5 users to use dot instead. (The "pointy block" use of C<< -> >> in Perl 5 requires preceding whitespace when the arrow could be confused with a postfix, that is when an infix is expected. @@ -4184,7 +4184,6 @@ or you can let the system autogenerate one for you based on the corresponding infix operator, probably by currying: - # (examples, actual system may define prefix:(**) instead) &prefix:<[*]> ::= &reduce.assuming(&infix:<*>, 1); &prefix:<[**]> ::= &reducerev.assuming(&infix:<**>); @@ -4290,7 +4289,7 @@ User-defined operators may define their own identity values, but there is no explicit identity property. The value is implicit in the behavior of the 0-arg reduce, so mathematical code wishing to find -the identity value for an operation can call C<prefix:("[$opname]")()> +the identity value for an operation can call C<prefix:["[$opname]"]()> to discover it. To call some other non-infix function as a reduce operator, you may Modified: docs/Perl6/Spec/S06-routines.pod =================================================================== --- docs/Perl6/Spec/S06-routines.pod 2010-05-21 06:55:13 UTC (rev 30741) +++ docs/Perl6/Spec/S06-routines.pod 2010-05-21 07:15:36 UTC (rev 30742) @@ -16,8 +16,8 @@ Created: 21 Mar 2003 - Last Modified: 13 May 2010 - Version: 133 + Last Modified: 21 May 2010 + Version: 134 This document summarizes Apocalypse 6, which covers subroutines and the new type system. @@ -196,7 +196,7 @@ the variable can be declared with the signature of the routines that will be assigned to it: - my &:(Str, int, int --> Grammar) $grammar_factory; + my $grammar_factory:(Str, int, int --> Grammar); $grammar_factory = sub (Str $name, int $n, int $x --> Grammar) { ... }; Covariance allows a routine (that has a more derived return type than what is @@ -211,7 +211,7 @@ The same signature can be used to mark the type of a closure parameter to another subroutine: - sub (int $n, &:(Str, int, int --> Grammar) $g_fact --> Str) { ... } + sub (int $n, &g_fact:(Str, int, int --> Grammar) --> Str) { ... } B<Trait> is the name for a compile-time (C<is>) property. See L<"Properties and traits">. @@ -462,8 +462,8 @@ infix:<+> infix:«+» infix:<<+>> - infix:('+') - infix:("+") + infix:['+'] + infix:["+"] Use the C<&> sigil just as you would on ordinary subs. @@ -482,7 +482,7 @@ operator. sub circumfix:<LEFTDELIM RIGHTDELIM> ($contents) {...} - sub circumfix:('LEFTDELIM','RIGHTDELIM') ($contents) {...} + sub circumfix:['LEFTDELIM','RIGHTDELIM'] ($contents) {...} Contrary to Apocalypse 6, there is no longer any rule about splitting an even number of characters. You must use a two-element slice. Such names @@ -492,12 +492,9 @@ do. (Symbolic references do not count as direct subscripts since they go through a parsing process.) The canonical form always uses angle brackets and a single space between slice elements. The elements -are not escaped, so C<< PKG::circumfix:('<','>') >> is canonicalized -to C<<< PKG::{'circumfix:<< >>'} >>>, and decanonicalizing always -involves stripping the outer angles and splitting on space, if any. -This works because a hash key knows how long it is, so there's no -ambiguity about where the final angle is. And space works because -operators are not allowed to contain spaces. +are escaped on brackets, so C<< PKG::circumfix:['<','>'] >> is canonicalized +to C<<< PKG::{'circumfix:<\< \>>'} >>>, and decanonicalizing may always +be done left-to-right. Operator names can be any sequence of non-whitespace characters including Unicode characters. For example: @@ -1937,16 +1934,16 @@ circumfix:<( )> dotty:<.> infix:<+> - infix_circumfix_meta_operator:('»','«') + infix_circumfix_meta_operator:['»','«'] infix_postfix_meta_operator:<=> infix_prefix_meta_operator:<!> package_declarator:<class> postcircumfix:<( )> postfix:<++> - postfix_prefix_meta_operator:('»') + postfix_prefix_meta_operator:['»'] prefix:<++> - prefix_circumfix_meta_operator:('[',']') - prefix_postfix_meta_operator:('«') + prefix_circumfix_meta_operator:['[',']'] + prefix_postfix_meta_operator:['«'] q_backslash:<\\> qq_backslash:<n> quote_mod:<c> Modified: docs/Perl6/Spec/S12-objects.pod =================================================================== --- docs/Perl6/Spec/S12-objects.pod 2010-05-21 06:55:13 UTC (rev 30741) +++ docs/Perl6/Spec/S12-objects.pod 2010-05-21 07:15:36 UTC (rev 30742) @@ -13,8 +13,8 @@ Created: 27 Oct 2004 - Last Modified: 1 May 2010 - Version: 102 + Last Modified: 21 May 2010 + Version: 103 =head1 Overview @@ -395,9 +395,9 @@ Another form of indirection relies on the fact that operators are named using a variant on pair notation, which gives you these forms: - $x.infix:($op)($y) - $x.prefix:($op) - $x.postfix:($op) + $x.infix:[$op]($y) + $x.prefix:[$op] + $x.postfix:[$op] Generally you see these with the literal angle bracket form of subscript: @@ -416,8 +416,8 @@ But it's probably better to spell out the syntactic category when the actual operator is not obvious: - $x.infix:($op)($y) - $x.prefix:($op) + $x.infix:[$op]($y) + $x.prefix:[$op] You must use a special syntax to call a private method: