Changeset 10050

Show
Ignore:
Timestamp:
04/21/06 17:39:01 (3 years ago)
Author:
yiyihu
Message:

Edit docs/Perl6/Makefile.PL. So that It will update docs/Perl6/Spec from "http://svn.perl.org/perl6/doc/trunk/design/syn" automatically.
In docs/Perl6/Spec/, S17.pod(Threads.pod) and S29.pod(Functions.pod) isn't in Spec yet, Added...
Update files in docs/Perl6/Spec too... :-)

Location:
docs/Perl6
Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Makefile.PL

    r9216 r10050  
    22use lib "../..", "../../inc"; 
    33use inc::Module::Install prefix => '../../inc'; 
     4use File::Path; 
    45 
    56name       ('Perl6-Doc'); 
     
    78license    ('perl'); 
    89 
     10 
     11my $svn_path = "/usr/bin/svn"; 
     12my $location = "http://svn.perl.org/perl6/doc/trunk/design/syn"; 
     13my $synopsis_svn = "synopsis-svn"; 
     14 
     15my %commands = ( 'checkout' => "$svn_path co $location $synopsis_svn", 
     16                 'update'   => "$svn_path update $synopsis_svn" 
     17                ); 
     18 
     19my %table = ( 'S01' => 'Overview', 
     20              'S02' => 'Syntax', 
     21              'S03' => 'Operator', 
     22              'S04' => 'Block', 
     23              'S05' => 'Rule', 
     24              'S06' => 'Subroutine', 
     25#             'S07' => '', 
     26#             'S08' => '', 
     27              'S09' => 'Structure', 
     28              'S10' => 'Package', 
     29              'S11' => 'Module', 
     30              'S12' => 'Object', 
     31              'S13' => 'Overload', 
     32              'S17' => 'Threads', 
     33              'S29' => 'Functions' 
     34              ); 
     35 
     36print "Checkout the newest Synopsis from $location\n"; 
     37if ( -e $svn_path ) { 
     38        if( -d $synopsis_svn && ! -f $synopsis_svn) { 
     39#               system( $commands{'update'} ); 
     40        } else { 
     41                system( $commands{'checkout'} ); 
     42        } 
     43} 
     44print "Moving newest synopsis to Spec\n"; 
     45for (keys %table) { 
     46        rename "$synopsis_svn/$_.pod", "Spec/$table{$_}.pod"; 
     47} 
     48print "Removing temporary download directory.\n"; 
     49rmtree $synopsis_svn, 0, 0; 
     50 
     51 
    952install_script( 'p6doc' ); 
    1053makemaker_args( PMLIBDIRS => [ grep { -d } glob("[A-Z]*") ]); 
  • docs/Perl6/Spec/Object.pod

    r9989 r10050  
    222222    .doit ()    # ILLEGAL (two terms in a row) 
    223223    .doit.()    # okay, no arguments, same as .doit() 
    224     .doit .()   # okay, no arguments, same as .doit() 
     224    .doit. .()  # okay, no arguments, same as .doit() (long dot form) 
    225225 
    226226However, you can turn any of the legal forms above into a list 
     
    231231    .doit (): 1,2,3     # ILLEGAL (two terms in a row) 
    232232    .doit.(1): 2,3      # okay, same as .doit(1,2,3) 
    233     .doit .(1,2): 3     # okay, same as .doit(1,2,3) 
     233    .doit. .(1,2): 3    # okay, same as .doit(1,2,3) 
    234234 
    235235In particular, this allows us to pass a closure in addition to the 
  • docs/Perl6/Spec/Rule.pod

    r9989 r10050  
    1212=head1 VERSION 
    1313 
    14    Maintainer: Patrick Michaud <pmichaud@pobox.com> 
     14   Maintainer: Patrick Michaud <pmichaud@pobox.com> and 
     15               Larry Wall <larry@wall.org> 
    1516   Date: 24 Jun 2002 
    16    Last Modified: 6 Apr 2006 
     17   Last Modified: 20 Apr 2006 
    1718   Number: 5 
    18    Version: 15 
     19   Version: 18 
    1920 
    2021This document summarizes Apocalypse 5, which is about the new regex 
    21 syntax.  We now try to call them "rules" because they haven't been 
    22 regular expressions for a long time.  (The term "regex" is still 
    23 acceptable.) 
     22syntax.  We now try to call them I<regex> because they haven't been 
     23regular expressions for a long time.  When referring to their use in 
     24a grammar, the term I<rule> is preferred. 
    2425 
    2526=head1 New match state and capture variables 
     
    3132C<$1>, etc.) are just elements of C<$/>. 
    3233 
    33 By the way, the numbered capture variables now start at C<$0>, C<$1>, 
    34 C<$2>, etc. See below. 
     34By the way, the numbered capture variables now start at C<$0> rather than 
     35C<$1>. See below. 
    3536 
    3637=head1 Unchanged syntactic features 
     
    6970 
    7071The extended syntax (C</x>) is no longer required...it's the default. 
     72(In fact, it's pretty much mandatory--the only way to get back to 
     73the old syntax is with the C<:Perl5>/C<:P5> modifier.) 
    7174 
    7275=item * 
     
    7982There is no C</e> evaluation modifier on substitutions; instead use: 
    8083 
    81      s/pattern/{ code() }/ 
     84     s/pattern/{ doit() }/ 
     85 
     86Instead of C</ee> say: 
     87 
     88     s/pattern/{ eval doit() }/ 
    8289 
    8390=item * 
     
    8895 
    8996Every modifier must start with its own colon.  The delimiter must be 
    90 separated from the final modifier by a colon or whitespace if it would 
    91 be taken as an argument to the preceding modifier. 
     97separated from the final modifier by whitespace if it would be taken 
     98as an argument to the preceding modifier (which is true for any 
     99bracketing character). 
    92100 
    93101=item * 
     
    120128Since this is implicitly anchored to the position, it's suitable for 
    121129building parsers and lexers.  The pattern you supply to a Perl macro's 
    122 "is parsed" trait has an implicit C<:p> modifier. 
     130C<is parsed> trait has an implicit C<:p> modifier. 
    123131 
    124132Note that 
     
    128136is roughly equivalent to 
    129137 
    130      m:p/.*? pattern/ 
    131  
    132 =item * 
    133  
    134 The new C<:once> modifier replaces the Perl 5 C<?...?> syntax: 
    135  
    136      m:once/ pattern /    # only matches first time 
    137  
    138 =item * 
    139  
    140 [Note: We're still not sure if :w is ultimately going to work exactly  
    141 as described below.  But this is how it works for now.] 
     138     m:p/.*? <( pattern )> / 
     139 
     140Also note that any regex called as a subrule is implicitly anchored to the 
     141current position anyway. 
     142 
     143=item * 
    142144 
    143145The new C<:w> (C<:words>) modifier causes whitespace sequences to be 
     
    164166C<< <?ws> >> can't decide what to do until it sees the data.  It still does 
    165167the right thing.  If not, define your own C<< <?ws> >> and C<:w> will use that. 
     168 
     169In general you don't need to use C<:w> within grammars because 
     170the parser rules automatically handle whitespace policy for you. 
    166171 
    167172=item * 
     
    178183=item * 
    179184 
    180 The new C<:perl5> modifier allows Perl 5 regex syntax to be used instead: 
    181  
    182      m:perl5/(?mi)^[a-z]{1,2}(?=\s)/ 
     185The new C<:Perl5> modifier allows Perl 5 regex syntax to be used instead: 
     186 
     187     m:Perl5/(?mi)^[a-z]{1,2}(?=\s)/ 
    183188 
    184189(It does not go so far as to allow you to put your modifiers at 
     
    195200general form.  So 
    196201 
    197      s:4x { (<?ident>) = (\N+) $$}{$0 => $1}; 
     202     s:4x [ (<?ident>) = (\N+) $$] [$0 => $1]; 
    198203 
    199204is the same as: 
    200205 
    201      s:x(4) { (<?ident>) = (\N+) $$}{$0 => $1}; 
     206     s:x(4) [ (<?ident>) = (\N+) $$] [$0 => $1]; 
    202207 
    203208which is almost the same as: 
    204209 
    205210     $_.pos = 0; 
    206      s:c{ (<?ident>) = (\N+) $$}{$0 => $1} for 1..4; 
     211     s:c [ (<?ident>) = (\N+) $$] [$0 => $1] for 1..4; 
    207212 
    208213except that the string is unchanged unless all four matches are found. 
     
    231236=item * 
    232237 
    233 With the new C<:ov> (C<:overlap>) modifier, the current rule will 
     238With the new C<:ov> (C<:overlap>) modifier, the current regex will 
    234239match at all possible character positions (including overlapping) 
    235240and return all matches in a list context, or a disjunction of matches 
     
    239244 
    240245     if $str ~~ m:overlap/ a (.*) a / { 
    241          @substrings = $/.matches();    # bracadabr cadabr dabr br 
    242      } 
    243  
    244 =item * 
    245  
    246 With the new C<:ex> (C<:exhaustive>) modifier, the current rule will match 
     246         @substrings = @;();    # bracadabr cadabr dabr br 
     247     } 
     248 
     249=item * 
     250 
     251With the new C<:ex> (C<:exhaustive>) modifier, the current regex will match 
    247252every possible way (including overlapping) and return all matches in a list 
    248253context, or a disjunction of matches in a scalar context. 
     
    251256 
    252257     if $str ~~ m:exhaustive/ a (.*) a / { 
    253          @substrings = $/.matches();    # br brac bracad bracadabr 
    254                                         # c cad cadabr d dabr br 
    255      } 
    256  
    257  
    258 =item * 
    259  
    260 The new C<:rw> modifier causes this rule to "claim" the current 
     258         say "@()";    # br brac bracad bracadabr c cad cadabr d dabr br 
     259     } 
     260 
     261Note that the C<~~> above can return as soon as the first match is found, 
     262and the rest of the matches may be performed lazily by C<@()>. 
     263 
     264[Conjecture: the C<:exhaustive> modifier should have an optional argument 
     265specifying how many seconds to run before giving up, since it's trivially 
     266easy to ask for the heat death of the universe to happen first.] 
     267 
     268=item * 
     269 
     270The new C<:rw> modifier causes this regex to I<claim> the current 
    261271string for modification rather than assuming copy-on-write semantics. 
    262272All the bindings in C<$/> become lvalues into the string, such 
     
    269279=item * 
    270280 
    271 The new C<:keepall> modifier causes this rule and all invoked subrules 
     281The new C<:keepall> modifier causes this regex and all invoked subrules 
    272282to remember everything, even if the rules themselves don't ask for 
    273283their subrules to be remembered.  This is for forcing a grammar that 
     
    276286=item * 
    277287 
    278 The C<:i>, C<:w>, C<:perl5>, and Unicode-level modifiers can be 
    279 placed inside the rule (and are lexically scoped): 
     288The new C<:ratchet> modifier causes this regex to not backtrack by default. 
     289(Generally you do not use this modifier directly, since it's implied by 
     290C<token> and C<rule> declarations.)  The effect of this modifier is 
     291to imply a C<:> after every construct that could backtrack, including 
     292bare C<*>, C<+>, and C<?> quantifiers, as well as alternations. 
     293 
     294=item * 
     295 
     296The new C<:panic> modifier causes this regex and all invoked subrules 
     297to try to backtrack on any rules that would otherwise default to 
     298not backtracking because they have C<:ratchet> set.  Never panic 
     299unless you're desperate and want the pattern matcher to do a lot of 
     300unnecessary work.  If you have an error in your grammar, it's almost 
     301certainly a bad idea to fix it by backtracking. 
     302 
     303=item * 
     304 
     305The C<:i>, C<:w>, C<:Perl5>, and Unicode-level modifiers can be 
     306placed inside the regex (and are lexically scoped): 
    280307 
    281308     m/:w alignment = [:i left|right|cent[er|re]] / 
     
    298325 
    299326         m:fuzzy (pattern); 
    300          m:fuzzy:(pattern); 
    301327 
    302328or you'll end up with: 
     
    347373=item * 
    348374 
    349 An unescaped C<#> now always introduces a comment. 
     375An unescaped C<#> now always introduces a comment.  If followed 
     376by an opening bracket character (and if not in the first column), 
     377it introduces an embedded comment that terminates with the closing 
     378bracket.  Otherwise the comment terminates at the newline. 
    350379 
    351380=item * 
     
    367396=item * 
    368397 
    369 C<.> matches an "anything", while C<\N> matches an "anything except 
    370 newline". (The C</s> modifier is gone.)  In particular, C<\N> matches 
     398C<.> matches an I<anything>, while C<\N> matches an I<anything except 
     399newline>. (The C</s> modifier is gone.)  In particular, C<\N> matches 
    371400neither carriage return nor line feed. 
    372401 
     
    401430=item * 
    402431 
    403 You can call Perl code as part of a rule match by using a closure. 
     432You can call Perl code as part of a regex match by using a closure. 
    404433Embedded code does not usually affect the match--it is only used 
    405434for side-effects: 
     
    424453with a corresponding C<**{...}?> for minimal matching.  Space is 
    425454allowed on either side of the asterisks.  The curlies are taken to 
    426 be a closure returning a number or a range. 
     455be a closure returning an Int or a Range object. 
    427456 
    428457     / value was (\d ** {1..6}?) with ([\w]**{$m..$n}) / 
     
    432461     / [foo]**{1,3} / 
    433462 
    434 (At least, it fails in the absence of "C<use rx :listquantifier>", 
     463(At least, it fails in the absence of C<use rx :listquantifier>, 
    435464which is likely to be unimplemented in Perl 6.0.0 anyway). 
    436465 
     
    439468a closure that must be run in the general case, so you can use 
    440469it to generate a range on the fly based on the earlier matching. 
    441 (Of course, bear in mind the closure is run I<before> attempting to 
     470(Of course, bear in mind the closure must be run I<before> attempting to 
    442471match whatever it quantifies.) 
    443472 
    444473=item * 
    445474 
    446 C<< <...> >> are now extensible metasyntax delimiters or "assertions" 
     475C<< <...> >> are now extensible metasyntax delimiters or I<assertions> 
    447476(i.e. they replace Perl 5's crufty C<(?...)> syntax). 
    448477 
     
    455484=item * 
    456485 
    457 In Perl 6 rules, variables don't interpolate. 
    458  
    459 =item * 
    460  
    461 Instead they're passed "raw" to the rule engine, which can then decide 
     486In Perl 6 regexes, variables don't interpolate. 
     487 
     488=item * 
     489 
     490Instead they're passed I<raw> to the regex engine, which can then decide 
    462491how to handle them (more on that below). 
    463492 
     
    474503     / \Q$var\E / 
    475504 
    476 (To get rule interpolation use an assertion - see below) 
     505However, if C<$var> contains a Regex object, rather attempting to 
     506convert it to a string, it is called as a subrule, as if you said 
     507C<< <$var> >>.  (See assertions below.)  This form does not capture, 
     508and it fails if C<$var> is tainted. 
    477509 
    478510=item * 
     
    487519 
    488520 
    489 As with a scalar variable, each element is matched as a literal. 
     521As with a scalar variable, each element is matched as a literal 
     522unless it happens to be a Regex object, in which case it is matched 
     523as a subrule.  As with scalar subrules, a tainted subrule always fails. 
     524All values pay attention to the current C<:ignorecase> setting. 
    490525 
    491526=item * 
     
    504539=item * 
    505540 
    506 If it is a string or rule object, it is executed as a subrule. 
    507  
    508 =item * 
    509  
    510 If it has the value 1, nothing special happens beyond the match. 
     541If the value is a string, it is matched literally, starting after where 
     542the key left off matching.  As a natural consequence, if the value is 
     543C<"">, nothing special happens except that the key match succeeds. 
     544 
     545=item * 
     546 
     547If it is a Regex object, it is executed as a subrule, with an initial 
     548position I<after> the matched key.  As with scalar subrules, a tainted 
     549subrule always fails, and no capture is attempted. 
     550 
     551=item * 
     552 
     553If the value is a number, the key is rematched ignoring any keys 
     554longer than the number.  (This is measured in the default Unicode 
     555level in effect where the hash was declared, usually graphemes. If 
     556the current Unicode level is lower, the results are as if the string 
     557to be matched had been upconverted to the hash's Unicode level.  If 
     558the current Unicode level is higher, the results are undefined if the 
     559string contains any characters whose interpretation would be changed 
     560by the higher Unicode level, such as language-dependent ligatures.) 
    511561 
    512562=item * 
     
    516566=back 
    517567 
     568All hash keys, and values that are strings, pay attention to the 
     569C<:ignorecase> setting.  (Subrules maintain their own case settings.) 
     570 
    518571=back 
    519572 
     
    524577=item * 
    525578 
    526 The first character after C<< < >> determines the behaviour of the assertion. 
     579The first character after C<< < >> determines the behavior of the assertion. 
    527580 
    528581=item * 
     
    540593     / <after pattern> /     # was /(?<pattern)/ 
    541594 
    542      / <ws> /                # match whitespace by :w rules 
     595     / <ws> /                # match whitespace by :w policy 
    543596 
    544597     / <sp> /                # match a space char 
     
    548601It is illegal to do lookbehind on a pattern that cannot be reversed. 
    549602 
     603Note: the effect of a forward-scanning lookbehind at the top level 
     604can be achieved with: 
     605 
     606    / .*? prestuff <( mainpat )> / 
     607 
    550608=item * 
    551609 
     
    557615     / <?ident> <?ws> /      # nothing captured 
    558616 
    559 =item * 
    560  
    561 A leading C<$> indicates an indirect rule.  The variable must contain 
    562 either a hard reference to a rule, or a string containing the rule. 
    563  
    564 =item * 
    565  
    566 A leading C<::> indicates a symbolic indirect rule: 
    567  
    568      / <::($somename)> 
    569  
    570 The variable must contain the name of a rule. 
    571  
    572 =item * 
    573  
    574 A leading C<@> matches like a bare array except that each element 
    575 is treated as a rule (string or hard ref) rather than as a literal. 
    576  
    577 =item * 
    578  
    579 A leading C<%> matches like a bare hash except that each key 
    580 is treated as a rule (string or hard ref) rather than as a literal. 
    581  
    582 =item * 
    583  
    584 A leading C<{> indicates code that produces a rule to be interpolated 
    585 into the pattern at that point: 
     617The non-capturing behavior may be overridden with a C<:keepall>. 
     618 
     619=item * 
     620 
     621A leading C<$> indicates an indirect subrule.  The variable must contain 
     622either a Regex object, or a string to be compiled as the regex.  The 
     623string is never matched literally. 
     624 
     625By default C<< <$foo> >> is captured into C<< $<foo> >>, but you can 
     626use the C<< <?$foo> >> form to suppress capture, and you can always say 
     627C<< $<$foo> := <$foo> >> if you prefer to include the sigil in the key. 
     628 
     629=item * 
     630 
     631A leading C<::> indicates a symbolic indirect subrule: 
     632 
     633     / <::($somename)> / 
     634 
     635The variable must contain the name of a subrule.  By the rules of 
     636single method dispatch this is first searched for in the current 
     637grammar and its ancestors.  If this search fails an attempt is made 
     638to dispatch via MMD, in which case it can find subrules defined as 
     639multis rather than methods.  This form is not captured by default. 
     640 
     641=item * 
     642 
     643A leading C<@> matches like a bare array except that each element is 
     644treated as a subrule (string or Regex object) rather than as a literal. 
     645That is, a string is forced to be compiled as a subrule rather than 
     646matched literally.  (There is no difference for a Regex object.) 
     647 
     648By default C<< <@foo> >> is captured into C<< $<foo> >>, but you can 
     649use the C<< <?@foo> >> form to suppress capture, and you can always say 
     650C<< $<@foo> := <@foo> >> if you prefer to include the sigil in the key. 
     651 
     652=item * 
     653 
     654A leading C<%> matches like a bare hash except that each value is 
     655always treated as a subrule, even if it is a string that must be compiled 
     656to a regex at match time. 
     657 
     658By default C<< <%foo> >> is captured into C<< $<foo> >>, but you can 
     659use the C<< <?%foo> >> form to suppress capture, and you can always say 
     660C<< $<%foo> := <%foo> >> if you prefer to include the sigil in the key. 
     661 
     662With both bare hash and hash in angles, the key is always skipped 
     663over before calling any subrule in the value.  That subrule may, however, 
     664magically access the key anyway as if the subrule had started before the 
     665key and matched with C<< <KEY> >> assertion.  That is, C<< $<KEY> >> 
     666will contain the keyword or token that this subrule was looked up under, 
     667and that value will be returned by the current match object even if 
     668you do nothing special with it within the match.  (This also works 
     669for the name of a macro as seen from an C<is parsed> regex, since 
     670internally that turns into a hash lookup.) 
     671 
     672As with bare hash, the longest key matches according to the venerable 
     673I<longest token rule>, but in addition, you may combine multiple hashes 
     674under the same longest-token consideration like this: 
     675 
     676    <%statement|%prefix|%term> 
     677 
     678This means that, despite being in a later hash, C<< %term<food> >> 
     679will be selected in preference to C<< %prefix<foo> >> because it's 
     680the longer token.  However, if there is a tie, the earlier hash wins, 
     681so C<< %statement<if> >> hides any C<< %prefix<if> >> or C<< %term<if> >>. 
     682 
     683In contrast, if you say 
     684 
     685    [ <%prefix> | <%term> ] 
     686 
     687a C<< %prefix<foo> >> would be selected in preference to a C<< %term<food> >>. 
     688(Which is not what you usually want if your language is to do longest-token 
     689consistently.) 
     690 
     691=item * 
     692 
     693A leading C<{> indicates code that produces a regex to be interpolated 
     694into the pattern at that point as a subrule: 
    586695 
    587696     / (<?ident>)  <{ %cache{$0} //= get_body($0) }> / 
     
    590699 
    591700As with an ordinary embedded closure, an B<explicit> return from a 
    592 rule closure binds the I<result object> for this match, ignores the 
    593 rest of the current rule, and reports success: 
    594  
    595         / (\d) <{ return $0.sqrt }> NotReached /; 
     701regex closure binds the I<result object> for this match, ignores the 
     702rest of the current regex, and reports success: 
     703 
     704        / (\d) <{ return $0.sqrt }> NotReached /; 
    596705 
    597706This has the effect of capturing the square root of the numified string, 
     
    604713 
    605714A leading C<&> interpolates the return value of a subroutine call as 
    606 a rule.  Hence 
     715a regex.  Hence 
    607716 
    608717     <&foo()> 
     
    614723=item * 
    615724 
    616 In any case of rule interpolation, if the value already happens to be 
    617 a rule object, it is not recompiled.  If it is a string, the compiled 
     725In any case of regex interpolation, if the value already happens to be 
     726a Regex object, it is not recompiled.  If it is a string, the compiled 
    618727form is cached with the string so that it is not recompiled next 
    619728time you use it unless the string changes.  (Any external lexical 
     
    621730interpolated with unbalanced bracketing.  An interpolated subrule 
    622731keeps its own inner C<$/>, so its parentheses never count toward the 
    623 outer rules groupings.  (In other words, parenthesis numbering is always 
     732outer regexes groupings.  (In other words, parenthesis numbering is always 
    624733lexically scoped.) 
    625734 
     
    654763    / <after foo> \d+ <before bar> / 
    655764 
    656 except that the scan for "foo" can be done in the forward direction, 
    657 while a lookbehind assertion would presumably scan for \d+ and then 
    658 match "foo" backwards.  The use of C<< <(...)> >> affects only the 
    659 meaning of the "result object" and the positions of the beginning and 
     765except that the scan for "C<foo>" can be done in the forward direction, 
     766while a lookbehind assertion would presumably scan for C<\d+> and then 
     767match "C<foo>" backwards.  The use of C<< <(...)> >> affects only the 
     768meaning of the I<result object> and the positions of the beginning and 
    660769ending of the match.  That is, after the match above, C<$()> contains 
    661770only the digits matched, and C<.pos> is pointing to after the digits. 
     
    663772through C<$/>. 
    664773 
     774It is a syntax error to use an unbalanced C<< <( >> or C<< )> >>. 
     775 
    665776=item * 
    666777 
     
    718829     / <!before _ > /    # We aren't before an _ 
    719830 
     831Note that C<< <!alpha> >> is different from C<< <-alpha> >> because the 
     832latter matches C</./> when it is not an alpha. 
     833 
     834=item * 
     835 
     836Conjecture: Multiple opening angles are matched by a corresponding 
     837number of closing angles, and otherwise function as single angles. 
     838This can be used to visually isolate unmatched angles inside: 
     839 
     840    <<<Ccode: a >> 1>>> 
     841 
    720842=back 
    721843 
     
    732854 
    733855The C<\L...\E>, C<\U...\E>, and C<\Q...\E> sequences are gone.  In the 
    734 rare cases that need them you can use C<< <{ lc $rule }> >> etc. 
     856rare cases that need them you can use C<< <{ lc $regex }> >> etc. 
    735857 
    736858=item * 
     
    800922=back 
    801923 
    802 =head1 Regexes are rules 
     924=head1 Regexes really are regexes now 
    803925 
    804926=over 
     
    812934The Perl 6 equivalents are: 
    813935 
    814      rule { pattern }    # always takes {...} as delimiters 
    815        rx / pattern /    # can take (almost any) chars as delimiters 
     936     regex { pattern }    # always takes {...} as delimiters 
     937        rx / pattern /    # can take (almost any) chars as delimiters 
    816938 
    817939You may not use whitespace or alphanumerics for delimiters.  Space is 
    818940optional unless needed to distinguish from modifier arguments or 
    819941function parens.  So you may use parens as your C<rx> delimiters, 
    820 but only if you interpose a colon or whitespace: 
    821  
    822      rx:( pattern )      # okay 
     942but only if you interpose whitespace: 
     943 
    823944     rx ( pattern )      # okay 
    824945     rx( 1,2,3 )         # tries t