UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

12 lines 6.16 kB
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#273f79"/><link rel="stylesheet" href="lpdoc.css" type="text/css"/><script type="text/javascript" src="lpdoc.js"></script><title>Version string parsing and comparison &mdash; The Ciao System v1.22</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">&#9776;</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="ExtraLibs.html">&#x2191;</a><a class="lpdoc-navbutton" href="source_tree.html">&#x2190;</a><a class="lpdoc-navbutton" href="librowser.html">&#x2192;</a><a class="lpdoc-navbutton" href="ciaosearch.html">&#x1F50D;</a></span><span><a href="ciaofulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciao.html">The Ciao System</a> &raquo;<br/> </li><li><a href="ExtraLibs.html">PART VIII - Additional libraries</a> &raquo;<br/> </li><li><a href=""><strong>Version string parsing and comparison</strong></a></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li><li><a href="#Documentation on exports">Documentation on exports</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Version string parsing and comparison</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#version_strings"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Jose F. Morales" href="ciaosearch.html#Jose F. Morales">Jose F. Morales</a>.<p> This module contains operations to work with version strings (as atoms). The specification of the format and operations is partially inspired on <a href="http://semver.org/">Semantic Versioning</a>.<p>Normal versions are specified as strings of the form <tt>X.Y.Z</tt>, where <tt>X</tt>, <tt>Y</tt>, and <tt>Z</tt> are non-negative integers. The components denote the major, minor, and patch version, respectively. Missing version numbers are assumed to be 0.<p>Pre-release versions include an optional <em>pre-release</em> identifier (<tt>X.Y.Z-Prerelease</tt>), which itself may contain many dot separated components.<p>Versions are compared by comparing each component from left to right. Each component is compared numerically (if numbers) or lexicographically (if not numbers). Numeric components have lower precedence than non-numeric components. A pre-release version has lower precedence than its corresponding normal version.<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/><tt>:- use_module(library(version_strings)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#version_parse/4"><tt>version_parse/4</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#version_split_patch/3"><tt>version_split_patch/3</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#version_compare/3"><tt>version_compare/3</tt></a>. </ul></ul></div></div><div id="Documentation on exports"><h2>Documentation on exports</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="version_parse/4" href="ciaosearch.html#version_parse/4">version_parse/4</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>version_parse(VerAtm,Major,Minor,Patch)</tt> </span><p>Parse a version string into numeric values for major, minor, and patch numbers</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="version_split_patch/3" href="ciaosearch.html#version_split_patch/3">version_split_patch/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>version_split_patch(VerAtm,VerNopatchAtm,PatchAtm)</tt> </span><p>Split version <span class="lpdoc-var">VerAtm</span> into major and minor <span class="lpdoc-var">VerNopatchAtm</span>, and patch and prerelease <span class="lpdoc-var">PatchAtm</span>)</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="version_compare/3" href="ciaosearch.html#version_compare/3">version_compare/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>version_compare(C,A,B)</tt> </span><p>Compare versions <span class="lpdoc-var">A</span> and <span class="lpdoc-var">B</span> (see <a class="lpdoc-idx-anchor" id="3" href="term_compare.html#compare/3"><tt>compare/3</tt></a> for values of <span class="lpdoc-var">C</span>)</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> </div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="4" href="lists.html"><tt>lists</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="5" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>