Author: lwall
Date: 2010-05-17 18:08:01 +0200 (Mon, 17 May 2010)
New Revision: 30667

Modified:
   docs/Perl6/Spec/S05-regex.pod
Log:
[S05] Disrequire retroactive semantics on :ii and :aa


Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod       2010-05-17 14:43:16 UTC (rev 30666)
+++ docs/Perl6/Spec/S05-regex.pod       2010-05-17 16:08:01 UTC (rev 30667)
@@ -16,8 +16,8 @@
 
     Created: 24 Jun 2002
 
-    Last Modified: 5 May 2010
-    Version: 119
+    Last Modified: 17 May 2010
+    Version: 120
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them I<regex> rather than "regular
@@ -4101,6 +4101,31 @@
 (Here we set those explicitly using the C<< <(...)> >> pair; otherwise we
 would have had to use lookbehind to match the C<$>.)
 
+Please note that the C<:ii>/C<:samecase> and C<:aa>/C<:sameaccent>
+switches are really two different modifiers in one, and when the compiler 
desugars
+the quote-like forms it distributes semantics to both the pattern
+and the replacement.  That is, C<:ii> on the replacement implies a C<:i> on the
+pattern, and C<:aa> implies C<:a>.  The proper method equivalents to:
+
+    s:ii/foo/bar/
+    s:aa/boo/far/
+
+are not:
+
+    .subst(/foo/, 'bar', :ii)   # WRONG
+    .subst(/boo/, 'far', :aa)   # WRONG
+
+but rather:
+
+    .subst(rx:i/foo/, 'bar', :ii)   # okay
+    .subst(rx:a/boo/, 'far', :aa)   # okay
+
+It is specifically I<not> required of an implementation that it treat
+the regexes as generic with respect to case and accent.  Retroactive
+recompilation is considered harmful.  If an implement does do lazy
+generic case and accent semantics, it is erroneous and non-portable
+for a program to depend on it.
+
 =head1 Positional matching, fixed width types
 
 =over

Reply via email to