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

0 views
Skip to first unread message

la...@cvs.perl.org

unread,
Mar 8, 2007, 12:35:53 AM3/8/07
to perl6-l...@perl.org
Author: larry
Date: Wed Mar 7 21:35:52 2007
New Revision: 14319

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

Log:
Definition of version sorting order.


Modified: doc/trunk/design/syn/S02.pod
==============================================================================
--- doc/trunk/design/syn/S02.pod (original)
+++ doc/trunk/design/syn/S02.pod Wed Mar 7 21:35:52 2007
@@ -2546,6 +2546,44 @@
it as a named argument, in which case saying C<< :ver<1.2.3beta> >> is fine.
See S11 for more on using versioned modules.

+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
+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:
+
+ 1.2.1alpha1
+ 1.2.1.alpha1
+ 1.2.1alpha.1
+ 1.2.1.alpha.1
+
+And these are also equivalent:
+
+ 1.2.1_01
+ 1.2.1_1
+ 1.2.1._1
+ 1.2.1_1
+ 1.2.1._.1
+ 001.0002.0000000001._.00000000001
+
+So these are in sorted version order:
+
+ 1.2.0.999
+ 1.2.1_01
+ 1.2.1_2
+ 1.2.1_003
+ 1.2.1a1
+ 1.2.1.alpha1
+ 1.2.1b1
+ 1.2.1.beta1
+ 1.2.1.gamma
+ 1.2.1α1
+ 1.2.1β1
+ 1.2.1γ
+ 1.2.1
+
=back

=head1 Context

Geoffrey Broadwell

unread,
Mar 8, 2007, 12:52:54 PM3/8/07
to la...@cvs.develooper.com, perl6-l...@perl.org
On Wed, 2007-03-07 at 21:35 -0800, la...@cvs.perl.org wrote:
> +So these are in sorted version order:
> +
> + 1.2.0.999
> + 1.2.1_01
> + 1.2.1_2
> + 1.2.1_003
> + 1.2.1a1
> + 1.2.1.alpha1
> + 1.2.1b1
> + 1.2.1.beta1
> + 1.2.1.gamma
> + 1.2.1α1
> + 1.2.1β1
> + 1.2.1γ
> + 1.2.1

The paragraph above this should explain why the last line (missing a
last part) sorts to the end. I'm assuming the intent is so that
pre-releases sort before final releases, we just need to specify that
intent as part of the sort definition.

Debian has crazy version numbers that we can use to test the
completeness of our sorting definition. For example, here's one I
noticed in this morning's Etch updates:

1.39+1.40-WIP-2006.11.14+dfsg-2

How do symbols (especially + and -, but don't forget others) sort? UTF8
sorting? And do they introduce new fields?

And of course, there's epoch notation:

2:20060501cvs-10

Will we handle version epochs, and if so, how? At first I thought "Just
push this into the auth field" and then I wondered "What if cpan:DCONWAY
decides to change numbering plan on one of his own modules?"


-'f


Reply all
Reply to author
Forward
0 new messages