Wow, this is a blast from the past.<br><br><div class="gmail_quote">On Wed, Apr 9, 2008 at 12:57 PM, Andreas Raab &lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt; wrote:</div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
Question: Is there an implementation dependency for that or is it simply that VersionNumber is being overly paranoid here? In its current incarnation it&#39;s basically useless for me and I&#39;d rather have the check be for negative numbers only.<br>
</blockquote><div class="gmail_quote"><span class="Apple-style-span" style="border-collapse: collapse;"><br class="webkit-block-placeholder"></span></div><div class="gmail_quote"><span class="Apple-style-span" style="border-collapse: collapse;">That&#39;s just a design decision I made. &nbsp;I felt was would be confusing to have version numbers &quot;1&quot; and &quot;1.0&quot; in the same lineage. &nbsp;When you create a branch, you would make &quot;1.1&quot; based on &quot;1&quot;.</span></div>
<div class="gmail_quote"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">
John Thornborrow wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8x;border-left:1px #ccc solid;padding-left:1ex">
Wouldn&#39;t that just be &quot;Version 1&quot; ?<br>
</blockquote>
<br></div>
Simplified example. The real version number I&#39;m interested in looks like &quot;1.0.34&quot;. But it looks like VersionNumber is a no-go for me anyway as you can&#39;t even compare, e.g., &#39;1.1.1&#39; asVersion &lt;= &#39;1.2.3&#39; asVersion. Does anyone actually use VersionNumber? I must be missing the real use cases for it.</blockquote>
<div><br class="webkit-block-placeholder"></div><div>I&#39;m curious whether you&#39;d expect this to return true or false (I&#39;m guess true). &nbsp;The reason it refuses that compasion is that #&lt; is meant to test whether a given version number is an ancestor of another. &nbsp;If you want the stringish comparison behavior, you could just use string. &nbsp;Or, you could extend the class with a different comparison method to do what you want. &nbsp;The motivation for this class was to give a structured way to used dotted number strings to encapsulate information about versions and branches. &nbsp;I&#39;ve copied the class comments below.</div>
<div><br class="webkit-block-placeholder"></div><div>- Stephen</div><div><br class="webkit-block-placeholder"></div><div>---------------------</div><div><div>I am a version number. &nbsp;My representation allows me to handle an entire tree of versions. &nbsp;Once created, an instance should not change (note: VersionNumbers could be canonicalized like Symbols, but are not currently). &nbsp;</div>
<div><br class="webkit-block-placeholder"></div><div>I am a magnitude so that you can see if one version preceeds another (only if the two versions are in the same branch). &nbsp;</div><div>VersionNumber fromString: &#39;1.0&#39;.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.1&#39; asVersion &lt; &#39;2.2.1&#39; asVersion<span class="Apple-tab-span" style="white-space:pre">        </span>&quot;true&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.3&#39; asVersion &lt; &#39;2.2.1&#39; asVersion<span class="Apple-tab-span" style="white-space:pre">        </span>&quot;error different branches&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.3&#39; asVersion inSameBranchAs: &#39;2.2.1&#39; asVersion<span class="Apple-tab-span" style="white-space:pre">        </span>&quot;false, why the previous one failed.&quot;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.1&#39; asVersion = &#39;2.1&#39; asVersion<span class="Apple-tab-span" style="white-space:pre">                </span>&quot;true, obviously&quot;</div><div><br class="webkit-block-placeholder">
</div><div>To get the next version number in the same branch:</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.3.4&#39; asVersion next<span class="Apple-tab-span" style="white-space:pre">        </span>&quot;2.3.5&quot;</div>
<div><br class="webkit-block-placeholder"></div><div>To get the next version number, starting a new branch:</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.3.4&#39; asVersion branchNext<span class="Apple-tab-span" style="white-space:pre">                </span>&quot;<a href="http://2.3.4.1">2.3.4.1</a>&quot;</div>
<div><br class="webkit-block-placeholder"></div><div>To get the common base version of any two version numbers (useful for merging):</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&#39;2.3.8&#39; asVersion commonBase: &#39;<a href="http://2.3.4.1">2.3.4.1</a>&#39; asVersion<span class="Apple-tab-span" style="white-space:pre">                </span>&quot;2.3.4&quot;</div>
<div><br class="webkit-block-placeholder"></div></div></div>