On Thu, Apr 23, 2009 at 7:14 AM, Zefram <zef...@fysh.org> wrote:
> John Peacock wrote:
>>How would you translate them?
>
> I suggest not translating them.  Compare tuple against tuple, or
> float against float, but with tuple against float only compare the
> integer/first part.

The problem -- the real, core problem -- is that perl *has* to be able
to compare them.

    # Foo.pm
    package Foo;
    use version; our version = qv("v1.7.0");
    1;

    # main.pl
    use Foo 1.06;   # dies --> 1.06 is 1.60.0

All the speculation of how versions *should* be compared or converted
is largely irrelevant because perl already does it this way.  (Or
maybe it does 1.7.0 -> 1.007, but that still fails.)

A naive conversion from numeric version to tuples breaks other people's code.

Given that constraint, I think we just need two things:

(a) have things that emit version numbers outside Perl (into META.yml,
filenames, indices, whatever) do so in an unambiguous fashion.

(b) find a way to make it easier for authors not to screw up
converting from numeric to tuple.

For (a), I've proposed something (numeric or always vX.Y.Z), but there
are disagreements about whether or not to "allow" (i.e. recommend)
vX.Y or X.Y.Z.  I still say accept them as they are probably intended,
but never emit them.  (Don't get people in the habit of seeing them.)

For (b), simple documentation or simple tools.  I made the suggestion
(maybe on IRC) that something like "perl-reversion -bump -as-tuple"
should just do the right thing.  (Convert current version to tuple in
normal form, and then bump it.)

None of that changes how Perl handles numerics or tuples -- it's just
trying to make it easier for people to be consistent with what Perl
already does.

-- David

Reply via email to