Skip to content

Version comparison #6

@ErdaradunGaztea

Description

@ErdaradunGaztea

Use case

Comparing two version codes:

code_1 <- "1.5.10-11b"
code_2 <- "1.5.1"
ver_older_than(code_1, code_2)
# FALSE
ver_later_than(code_1, code_2)
# TRUE

Proposed name

Preferably something with older and later to be consistent with ver_oldest() and ver_latest(). A ver_ prefix would also be preferred. On the other hand, the names should not be too similar to the aforementioned functions. ver_is_older() would work well, but is_ prefix is usually connected with single argument check.
Thus, the current best is ver_older_than(). An alternative would be to have ver_compare() that returns -1, 0 and 1, but I don't like the low-level feel of this; in any case I'd want functions that return a boolean too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions