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

2007-03-09 Thread Smylers
Larry Wall writes:

> On Thu, Mar 08, 2007 at 09:05:32AM +, Smylers wrote:
> 
> : So I fear that people will do the same thing in Perl 6.  Which,
> : initially, will appear to work.  But then, some months later,
> : somebody upgrades the installed version of a module (or the program
> : gets deployed on another computer, which happens to have a more
> : recent version installed), and suddenly the program will break.
> 
> Nope, check your assumptions, you've got a big one that just ain't so.
> Perl 6 is specced to keep all the old versions of modules around in
> the library

Yeah, that's why I added "or the program gets deployed on another
computer, which happens to have a more recent version".

> (unless the new version claims to emulate the old version).  So an
> upgrade doesn't generally break fixed dependencies.

Aha!  So even if I specify that I want, say, version 1.3, if only
version 1.6 is installed but the module's author claims never to've
broken backwards compatibility then it will run anyway?  That's good.

> : * In many (most?) cases the breakage will be arbitrary, in that the
> :   module would've worked fine had it been allowed to run rather than
> :   being stopped by the version-checker.
> 
> It is allowed to run anyway,

Sorry, I don't quite understand that.  What does happen if a program
requests a version of a module that 

> : * It's a change from what was good practice in Perl 5.
> 
> s/good/common/;

I'd say that common practice in Perl 5 is merely to use a module and not
specify a version number at all!  Specifying a minimum version number is
an improvement -- obviously not ideal, but it is as much as can be done
straightforwardly with Perl 5.  And I think it'very likely people in the
habit of doing this in Perl 5 will, at least initially, specify a single
version number in Perl 6 C lines.

> Those who believe the stagnation of Perl 5 is caused by Perl 6 should
> go back and reread the 361 RFCs ... 

Sorry if my post came across as some kind of attack on Perl 6 as a whole
-- it certainly wasn't supposed to be!!  I'm very much in favour of the
way Perl 6 is going and the many improvements it brings.

(And I'm not sure what stagnation has to do with this thread, but for
what it's worth I think quite the opposite: Perl 6 has been the
inspiration for several good things people are already doing with Perl
5.)

Cheers.

Smylers


[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 I 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 C 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 C values use their own C<:ignorecase> settings.
+All string values pay attention to the current C<:ignorecase>
+and C<:basechar> settings, while C 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:


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

2007-03-09 Thread Aaron Crane
[EMAIL PROTECTED] writes:
> +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,

That should read "ignored", I dare say.

-- 
Aaron Crane


Re: lexical subs

2007-03-09 Thread Juerd Waalboer
Just a short note: please, if this is implemented, make sure that either
Perl 6 conforms to Perl 5 behaviour, or the other way around. 
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  
  convolution: ict solutions and consultancy <[EMAIL PROTECTED]>

Ik vertrouw stemcomputers niet.
Zie .


Re: lexical subs

2007-03-09 Thread Juerd Waalboer
Juerd Waalboer skribis 2007-03-09 21:27 (+0100):
> Just a short note: please, if this is implemented, make sure that either
> Perl 6 conforms to Perl 5 behaviour, or the other way around. 

Wanted to CC this list, but by accident replaced the To instead. Now
CC'ing p5p.
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  
  convolution: ict solutions and consultancy <[EMAIL PROTECTED]>

Ik vertrouw stemcomputers niet.
Zie .


[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] r14325 - doc/trunk/design/syn

2007-03-09 Thread larry
Author: larry
Date: Fri Mar  9 16:38:18 2007
New Revision: 14325

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

Log:
As noted by allbery_b++, Smylers++, and david.green++, we've thoroughly
neglected to thoroughly spec the intended version sharing and emulation model.


Modified: doc/trunk/design/syn/S11.pod
==
--- doc/trunk/design/syn/S11.pod(original)
+++ doc/trunk/design/syn/S11.podFri Mar  9 16:38:18 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <[EMAIL PROTECTED]>
   Date: 27 Oct 2004
-  Last Modified: 8 Mar 2006
+  Last Modified: 9 Mar 2006
   Number: 11
-  Version: 16
+  Version: 17
 
 =head1 Overview
 
@@ -351,6 +351,41 @@
 
 specifically rules out any prereleases.
 
+If two different modules in your program require two different
+versions of the same module, Perl will simply load both versions at
+the same time.  For modules that do not manage exclusive resources,
+the only penalty for this is memory, and the disk space in the library
+to hold both the old and new versions.  For modules that do manage
+an exclusive resource, such as a database handle, there are two approaches
+short of requiring the user to upgrade.  The first is simply to refactor
+the module into a stable supplier of the exclusive resource that doesn't
+change version often, and then the outer wrappers of that resource can
+both be loaded and use the same supplier of the resource.
+
+The other approach is for the module to keep the management of its exclusive
+resource, but offer to emulate older versions of the API.  Then if there
+is a conflict over which version to use, the new one is used by both users,
+but each gets a view that is consistent with the version it thinks it is
+using.  Of course, this depends crucially on how well the new version
+actually emulates the old version.
+
+To declare that a module emulates an older version, declare it like this:
+
+class Dog:<1.2.1 cpan:JRANDOM> emulates :<1.2.0>;
+
+Or to simply exclude use of the older module and (presumably) force
+the user to upgrade:
+
+class Dog:<1.2.1 cpan:JRANDOM> excludes :<1.2.0>;
+
+The name is parsed like a C wildcard, and you can have more than one,
+so you can say things like:
+
+class Dog:<1.2.1 cpan:JRANDOM>
+emulates Dog:auth(DCONWAY|JCONWAY|TCONWAY):ver<1.0+>
+excludes Fox:<3.14159 http://oreillymedia.com>
+emulates Wolf:from;
+
 =head1 Forcing Perl 6
 
 To get Perl 6 parsing rather than the default Perl 5 parsing,