Author: larry
Date: Thu Mar 8 10:32:50 2007
New Revision: 14320
Modified:
doc/trunk/design/syn/S02.pod
doc/trunk/design/syn/S11.pod
Log:
Further clarification of version syntax as requested by geoff++ and others.
Modified: doc/trunk/design/syn/S02.pod
==============================================================================
--- doc/trunk/design/syn/S02.pod (original)
+++ doc/trunk/design/syn/S02.pod Thu Mar 8 10:32:50 2007
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <[EMAIL PROTECTED]>
Date: 10 Aug 2004
- Last Modified: 6 Mar 2007
+ Last Modified: 8 Mar 2007
Number: 2
- Version: 92
+ Version: 93
This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
@@ -2549,15 +2549,19 @@
Version objects have a predefined sort order that follows most people's
intuition about versioning: each sorting position sorts numerically
between numbers, alphabetically between alphas, and alphabetics in a
-position before numerics. Numbers ignore leading zeros. For splitting
+position before numerics. Missing final positions are assumed to be '.0'.
+Except for '0' itself, numbers ignore leading zeros. For splitting
into sort positions, if any alphabetics (including underscore) are
-immediately adjacent to a number, a dot is assumed between them,
-so these are all equivalent:
+immediately adjacent to a number, a dot is assumed between them.
+Likewise any non-alphanumeric character is assumed to be equivalent
+to a dot. So these are all equivalent:
+ 1.2.1alpha1.0
1.2.1alpha1
1.2.1.alpha1
1.2.1alpha.1
1.2.1.alpha.1
+ 1.2-1+alpha/1
And these are also equivalent:
@@ -2567,6 +2571,7 @@
1.2.1_1
1.2.1._.1
001.0002.0000000001._.00000000001
+ 1.2.1._.1.0.0.0.0.0
So these are in sorted version order:
@@ -2584,6 +2589,16 @@
1.2.1γ
1.2.1
+Note how the last pair assume that an implicit .0 sorts after anything
+alphabetic, and that alphabetic is defined according to Unicode,
+not ASCII. The intent of all this is to make sure that prereleases
+sort before releases. Note also that this is still a subset of the
+versioning schemes seen in the real world. Modules with such strange
+versions can still be used by Perl since by default Perl imports
+external modules by exact version number. (See S11.) Only range
+operations will be compromised by an unknown foreign collation order,
+such as a system that sorts "delta" after "gamma".
+
=back
=head1 Context
Modified: doc/trunk/design/syn/S11.pod
==============================================================================
--- doc/trunk/design/syn/S11.pod (original)
+++ doc/trunk/design/syn/S11.pod Thu Mar 8 10:32:50 2007
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <[EMAIL PROTECTED]>
Date: 27 Oct 2004
- Last Modified: 1 Nov 2006
+ Last Modified: 8 Mar 2006
Number: 11
- Version: 15
+ Version: 16
=head1 Overview
@@ -261,22 +261,24 @@
use Dog:ver<1.2.1>:auth(Any);
-Saying C<1.2.1> specifies an I<exact> match on the version number,
-not a minimum match. To match more than one version, put a range
-operator in parens:
+Saying C<1.2.1> specifies an I<exact> match on that part of the
+version number, not a minimum match. To match more than one version,
+put a range operator as a selector in parens:
use Dog:ver(1.2.1..1.2.3);
use Dog:ver(1.2.1..^1.3);
use Dog:ver(1.2.1..*);
-Subversions are wildcarded, so C<1.2> really means C<1.2.*>. If you
-say:
+When specifying the version of your own module, C<1.2> is equivalent
+to C<1.2.0>, C<1.2.0.0>, and so on. However C<use> searches for
+modules matching a version prefix, so the subversions are wildcarded,
+and in this context C<1.2> really means C<1.2.*>. If you say:
use v6;
which is short for:
- use Perl:ver<6>;
+ use Perl:ver<6.*>;
you're asking for any version of Perl 6. You need to say something like
@@ -334,6 +336,21 @@
use Whiteness:from<perl5>:name<Acme::Bleach>ver<1.12>:auth<cpan:DCONWAY>;
use Whiteness:from<perl5 Acme::Bleach 1.12 cpan:DCONWAY>; # same thing
+The string form of a version recognizes the C<*> wildcard in place of any
+position. It also recognizes a trailing C<+>, so
+
+ :ver<6.2.3+>
+
+is short for
+
+ :ver(v6.2.3 .. v6.2.*)
+
+And saying
+
+ :ver<6.2.0+>
+
+specifically rules out any prereleases.
+
=head1 Forcing Perl 6
To get Perl 6 parsing rather than the default Perl 5 parsing,