[squeak-dev] Re: 1.0 not a valid VersionNumber?

Brett Kosinski fancypantalons at gmail.com
Wed Apr 9 17:54:03 UTC 2008


> Stephen Pair wrote:
>
> >    Simplified example. The real version number I'm interested in looks
> >    like "1.0.34". But it looks like VersionNumber is a no-go for me
> >    anyway as you can't even compare, e.g., '1.1.1' asVersion <= '1.2.3'
> >    asVersion. Does anyone actually use VersionNumber? I must be missing
> >    the real use cases for it.
> >
> >
> > I'm curious whether you'd expect this to return true or false (I'm guess
> true).  The reason it refuses that compasion is that #< is meant to test
> whether a given version number is an ancestor of another.  If you want the
> stringish comparison behavior, you could just use string.
> >
>
>  I wish...
>
>   '1.1.2' < '1.12.3'
>
>  => false

Yeah, fundamentally, what you're asking just doesn't make sense for
the semantics of the VersionNumber class.  You're basically comparing
two revisions on different branches,.

It sounds to me like you need a separate ReleaseNumber class, or
something similar, that uses major.minor.patchlevel.  Internally,
though, you should just be incrementing the VersionNumber
sequentially... then mapping the VersionNumber to some ReleaseNumber
when a release gets cut.

Brett.



More information about the Squeak-dev mailing list