Show
Ignore:
Timestamp:
09/22/08 08:18:55 (4 months ago)
Author:
pmoura
Message:

Added a syntax construct for easy access to parametric object proxies represented as Prolog facts when sending a message ({Proxy}::Message). Updated the "proxies" example to illustrate this new functionality.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/manuals/userman/objects.html

    r4270 r4470  
    194194</p> 
    195195<p> 
    196 Compound terms with the same functor and (usually) the same number of arguments as a parametric object identifier may act as <em>proxies</em> to a parametric object. Proxies may be stored on the database as Prolog facts and be used to represent different instantiations of a parametric object identifier. 
     196Compound terms with the same functor and (usually) the same number of arguments as a parametric object identifier may act as <em>proxies</em> to a parametric object. Proxies may be stored on the database as Prolog facts and be used to represent different instantiations of a parametric object identifier. Logtalk provides a convenient notation for accessing proxies represented as Prolog facts when sending a message: 
     197</p> 
     198<pre>{Proxy}::Message</pre> 
     199<p> 
     200In this context, the proxy argument is proved as a plain Prolog goal. If successful, the message is sent to the corresponding parametric object. Typically, the proof allows retrieving of parameter instantiations. This notation supports backtracking over the Prolog facts that unify with the proxy term. When this behavior is unwanted, is possible to commit to the first unifying fact by writing: 
     201</p> 
     202<pre>{Proxy}::(!, Message)</pre> 
     203<p> 
     204In most cases, however, the use of cuts is not necessary as this construct is usually used with a proxy argument that is partially instantiated in order to unify with a single Prolog fact. 
    197205</p> 
    198206 
     
    439447    <div class="copyright"> 
    440448        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    441         <span>Last updated on: May 21, 2008</span> 
     449        <span>Last updated on: September 22, 2008</span> 
    442450    </div> 
    443451    <div class="navbottom">