Re: [pacman-dev] Version comparison algorithm.

2019-03-20 Thread Allan McRae
On 20/3/19 11:13 pm, Maarten de Vries wrote: > On Wed, 20 Mar 2019 at 12:19, Richard Dodd wrote: >> >> I'm just trying to get a mathematically sound implementation of all the >> properties (traits in rust parlance) that the version exhibits. If there is >> an equivalence relation and a hash functi

Re: [pacman-dev] Version comparison algorithm.

2019-03-20 Thread Maarten de Vries
On Wed, 20 Mar 2019 at 12:19, Richard Dodd wrote: > > I'm just trying to get a mathematically sound implementation of all the > properties (traits in rust parlance) that the version exhibits. If there is > an equivalence relation and a hash function as above, then I can store > versions in a hash

Re: [pacman-dev] Version comparison algorithm.

2019-03-20 Thread Richard Dodd
I'm just trying to get a mathematically sound implementation of all the properties (traits in rust parlance) that the version exhibits. If there is an equivalence relation and a hash function as above, then I can store versions in a hash set/map. If there is a total ordering, then I can store versi

Re: [pacman-dev] Version comparison algorithm.

2019-03-16 Thread Dave Reisner
On Sat, Mar 16, 2019, 10:02 Richard Dodd wrote: > I'm writing to ask about the version comparison function `rpmvercmp` in > `libalpm/version.cL83`. The algorithm is complex and I'm trying to > understand its behavior. I want to hash using the package name and version > as a key, and so I need a h

[pacman-dev] Version comparison algorithm.

2019-03-16 Thread Richard Dodd
I'm writing to ask about the version comparison function `rpmvercmp` in `libalpm/version.cL83`. The algorithm is complex and I'm trying to understand its behavior. I want to hash using the package name and version as a key, and so I need a hash function where `i1 == i2 => hash(i1) == hash(i2)` acco