Skip to content

LETTER_SUFFIX behaviour issue? #37

@lizmat

Description

@lizmat

I'm trying to implement the libversion algorithm in the Raku Programming Language, and have some test failures that I think are somehow related to my misunderstanding of the algorithm.

Looking at https://github.com/repology/libversion/blob/master/doc/ALGORITHM.md , it states:

Version is split into separate all-alphabetic or all-numeric components. All other
characters are treated as separators. Empty components are not generated.

10.2alpha3..patch.4. → 10, 2, alpha, 3, patch, 4

Then later it states:

A special case exists for alphabetic component which follows numeric component,
and is not followed by another numeric component (1.0a, 1.0a.1, but not 1.0a1). Such
alphabetic component is assigned a different rank, LETTER_SUFFIX, which follows
NONZERO (choice of this behavior explained below).

I don't understand why 1.0a1 is not included in this constraint, and 1.0a.1 is. They both split into 1, 0, a, 1 do they not?

So is this a problem in the documentation? Or the algorithm? Or the tests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions