Changeset 4474 for trunk/manuals

Show
Ignore:
Timestamp:
09/25/08 19:24:17 (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.

Location:
trunk/manuals
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/manuals/index.html

    r4470 r4474  
    3232    <div class="copyright"> 
    3333        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    34         <span>Last updated on: September 22, 2008</span> 
     34        <span>Last updated on: September 26, 2008</span> 
    3535    </div> 
    3636    <div class="navbottom"> 
  • trunk/manuals/refman/control/to_object2.html

    r4384 r4474  
    2525 
    2626<pre>Object::Predicate 
    27      
     27{Proxy}::Predicate 
     28 
    2829(Object1, Object2, ...)::Predicate 
    2930(Object1; Object2; ...)::Predicate 
     
    3334<p> 
    3435Sends a message to an object. The message argument must match a public predicate of the receiver object. When the message corresponds to a protected or private predicate, the call is only valid if the <em>sender</em> matches the predicate scope container. We can also send the same message to either a conjunction or a disjunction of objects or send either a conjunction or disjunction of messages to the same object. 
     36</p> 
     37<p> 
     38The <code>{Proxy}::Predicate</code> syntax construct allows simplified access to parametric object <em>proxies</em>. Its operational semantics is equivalent to <code>once(Proxy), Proxy::Predicate</code> (however, exceptions thrown when proving <code>Proxy</code> are handled by the <code>::/2</code> control construct). 
    3539</p> 
    3640 
     
    4448    <dt>Either Object or Predicate is a variable:</dt> 
    4549        <dd><code>instantiation_error</code></dd> 
     50    <dt>Object is not a valid object identifier:</dt> 
     51        <dd><code>type_error(object_identifier, Object)</code></dd> 
    4652    <dt>Predicate is declared private:</dt> 
    4753        <dd><code>permission_error(access, private_predicate, Predicate)</code></dd> 
     
    5258    <dt>Object does not exist:</dt> 
    5359        <dd><code>existence_error(object, Object)</code></dd> 
     60</dl> 
     61<dl> 
     62    <dt>Proxy is a variable:</dt> 
     63        <dd><code>instantiation_error</code></dd> 
     64    <dt>Proxy is not a valid object identifier:</dt> 
     65        <dd><code>type_error(object_identifier, Proxy)</code></dd> 
     66    <dt>The predicate Proxy does not exist in the <em>user</em> pseudo-object:</dt> 
     67        <dd><code>existence_error(procedure, ProxyFunctor/ProxyArity)</code></dd> 
    5468</dl> 
    5569 
     
    6680    <div class="copyright"> 
    6781        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    68         <span>Last updated on: July 17, 2008</span> 
     82        <span>Last updated on: September 26, 2008</span> 
    6983    </div> 
    7084    <div class="navbottom"> 
  • trunk/manuals/refman/index.html

    r4447 r4474  
    321321    <div class="copyright"> 
    322322        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    323         <span>Last updated on: August 25, 2008</span> 
     323        <span>Last updated on: September 26, 2008</span> 
    324324    </div> 
    325325    <div class="navbottom"> 
  • trunk/manuals/userman/index.html

    r4470 r4474  
    304304    <div class="copyright"> 
    305305        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/> 
    306         <span>Last updated on: September 22, 2008</span> 
     306        <span>Last updated on: September 26, 2008</span> 
    307307    </div> 
    308308    <div class="navbottom"> 
  • trunk/manuals/userman/objects.html

    r4470 r4474  
    198198<pre>{Proxy}::Message</pre> 
    199199<p> 
    200 In 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> 
    204 In 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. 
     200In this context, the proxy argument is proved as a plain, deterministic Prolog goal. If successful, the message is sent to the corresponding parametric object. Typically, the proof allows retrieving of parameter instantiations. This construct should be used with a proxy argument that is sufficiently instantiated in order to unify with a single Prolog fact. 
    205201</p> 
    206202 
     
    447443    <div class="copyright"> 
    448444        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    449         <span>Last updated on: September 22, 2008</span> 
     445        <span>Last updated on: September 26, 2008</span> 
    450446    </div> 
    451447    <div class="navbottom">