Author: larry Date: Thu May 11 15:39:08 2006 New Revision: 9204 Modified: doc/trunk/design/syn/S03.pod doc/trunk/design/syn/S05.pod doc/trunk/design/syn/S09.pod
Log: Typos. Tightened up prefix:<*> to match only before sigils and brackets, so that *foo now always means GLOBAL::foo, and 0..*:by(2) works. Modified: doc/trunk/design/syn/S03.pod ============================================================================== --- doc/trunk/design/syn/S03.pod (original) +++ doc/trunk/design/syn/S03.pod Thu May 11 15:39:08 2006 @@ -14,7 +14,7 @@ Date: 8 Mar 2004 Last Modified: 11 May 2006 Number: 3 - Version: 28 + Version: 29 =head1 Changes to existing operators @@ -360,7 +360,7 @@ thing parses as a single token. A reduction operator really is a list operator, and is invoked as one. -Hence, you maybe implement a reduction operator in one of two ways. Either +Hence, you can implement a reduction operator in one of two ways. Either you can write an explicit list operator: proto prefix:<[+]> ([EMAIL PROTECTED]) { @@ -674,7 +674,7 @@ Since typeglobs are being removed, unary C<*> may now serve as an interpolator, by casting its single operand to a C<Capture> object -and insert it into the current argument list. +and inserting it into the current argument list. It can be used to interpolate an C<Array> or C<Hash> into the current call, as positional and named arguments respectively. @@ -737,6 +737,26 @@ You may use either of them on a scalar iterator to force it to iterate. +The C<*> operator is recognized only if the next character is a sigil +or an opening bracket, In front of an alphabetic character C<*> will +always be taken to mean C<GLOBAL::>. Otherwise it will be assumed +the C<*> has no argument. See next section. + +To interpolate a function's return value, therefore, you must say one +of these: + + push *(func()) + push *[func()] + push *&func() + +because + + push *func() + +means + + push GLOBAL::func() + =item * The "Whatever" operator If the C<*> prefix operator has I<no> argument, it captures the notion @@ -891,7 +911,7 @@ Perl 6 has 22 precedence levels (which is fewer than Perl 5): terms 42 "eek" $x /abc/ (1+2) a(1) :by(2) .meth listop - method postfix . .+ .? .* .() .[] .{} .:: .«» .= + method postfix . .+ .? .* .() .[] .{} .«» .:: .= autoincrement ++ -- exponentiation ** symbolic unary ! + - ~ ? $ @ % & * ** +^ ~^ ?^ \ ^ = Modified: doc/trunk/design/syn/S05.pod ============================================================================== --- doc/trunk/design/syn/S05.pod (original) +++ doc/trunk/design/syn/S05.pod Thu May 11 15:39:08 2006 @@ -152,14 +152,12 @@ =item * The new C<:s> (C<:sigspace>) modifier causes whitespace sequences -to be considered "significant". That is, they are replaced by a -whitespace matching rule, C<< <?ws> >>. - -Anyway, +to be considered "significant"; they are replaced by a whitespace +matching rule, C<< <?ws> >>. That is, m:s/ next cmd = <condition>/ -Same as: +is the same as: m/ <?ws> next <?ws> cmd <?ws> = <?ws> <condition>/ Modified: doc/trunk/design/syn/S09.pod ============================================================================== --- doc/trunk/design/syn/S09.pod (original) +++ doc/trunk/design/syn/S09.pod Thu May 11 15:39:08 2006 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 13 Sep 2004 - Last Modified: 21 Apr 2006 + Last Modified: 11 May 2006 Number: 9 - Version: 9 + Version: 10 =head1 Overview @@ -308,7 +308,7 @@ just like scalars -- the main caveat is that you have to use binding rather than assignment to set one without copying: - @b := @a[0..(*):by(2)] + @b := @a[0..*:by(2)] With PDLs in particular, this might alias each of the individual elements rather than the array as a whole. So modifications to @b @@ -340,7 +340,7 @@ semicolon-separated list of slice specifiers, also known as a multislice. A three-dimensional slice might look like this: - @x[0..10; 1,0; 1..(*):by(2)] + @x[0..10; 1,0; 1..*:by(2)] It is up to the implementation of C<@x> to decide how aggressively or lazily this subscript is evaluated, and whether the slice entails @@ -412,9 +412,9 @@ @nums[$min..$max:by(3)] @nums[$min..$max] - @nums[$min..(*):by(3)] - @nums[1..(*):by(2)] # the odds - @nums[0..(*):by(2)] # the evens + @nums[$min..*:by(3)] + @nums[1..*:by(2)] # the odds + @nums[0..*:by(2)] # the evens That's all just the standard Perl 6 notation for ranges. Additional syntactic relief is always available as long as it's predeclared