UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

14 lines 6.5 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>Mutable terms &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="ExtendLang.html">&#x2191;</a><a class="lpdoc-navbutton" href="global_vars.html">&#x2190;</a><a class="lpdoc-navbutton" href="indexer_doc.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="ExtendLang.html">PART IV - Language extensions</a> &raquo;<br/> </li><li><a href=""><strong>Mutable terms</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>Mutable terms</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#mutables"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Remy Haemmerle" href="ciaosearch.html#Remy Haemmerle">R&eacute;my Haemmerl&eacute;</a>.<p> This module provides mutable terms i.e. an abstract datatype provides with efficient backtrackable destructive assignment. In other words, any destructive assignments are transparently undone on baktracking. Modifications that are intended to survive backtracking must be done by asserting or retracting dynamic program clauses instead. Mutable must be prefered to destructive assignment of arbitrary terms using <a class="lpdoc-idx-anchor" id="0" href="odd.html#setarg/3"><tt>setarg/3</tt></a> of the module <a class="lpdoc-idx-anchor" id="1" href="odd.html"><tt>odd</tt></a> which does not have safe semantics.<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(mutables)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="2" href="#create_mutable/2"><tt>create_mutable/2</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#get_mutable/2"><tt>get_mutable/2</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#update_mutable/2"><tt>update_mutable/2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#mutable/1"><tt>mutable/1</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="create_mutable/2" href="ciaosearch.html#create_mutable/2">create_mutable/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>create_mutable(Datum,Mutable)</tt> </span><p>Unifies <span class="lpdoc-var">Datum</span> with a freshly created mutable term with initial value <span class="lpdoc-var">Datum</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="get_mutable/2" href="ciaosearch.html#get_mutable/2">get_mutable/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>get_mutable(Datum,Mutable)</tt> </span><p>Unifies <span class="lpdoc-var">Datum</span> with the current value of the mutable term <span class="lpdoc-var">Mutable</span>. <span class="lpdoc-var">Mutable</span> must be a mutable term.</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="update_mutable/2" href="ciaosearch.html#update_mutable/2">update_mutable/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>update_mutable(Datum,Mutable)</tt> </span><p>Updates the current value of the mutable term <span class="lpdoc-var">Mutable</span> to become <span class="lpdoc-var">Datum</span>. <span class="lpdoc-var">Mutable</span> must be a mutable term.</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="mutable/1" href="ciaosearch.html#mutable/1">mutable/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>mutable(Term)</tt> </span><p>Succeeds if <span class="lpdoc-var">Term</span> is currently instantiated to a mutable term.</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="6" href="datafacts_rt.html"><tt>datafacts_rt</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="odd.html"><tt>odd</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="8" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="dcg_doc.html"><tt>dcg</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="datafacts_doc.html"><tt>datafacts</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>