Show
Ignore:
Timestamp:
08/17/08 10:41:43 (5 months ago)
Author:
pmoura
Message:

Added support for declaring predicate aliases in the use_module/2 directive using the notation Original:Alias.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/manuals/migration/index.html

    r4412 r4431  
    226226As a general rule, the Prolog modules should be loaded (e.g. in the auxiliary Logtalk loader files) before compiling objects that make use of module predicates. This is mandatory whenever the module exports operator declarations that you want to use in your objects and categories (as in the example above). 
    227227</p> 
     228<p> 
     229Logtalk supports the declaration of predicate aliases in <code>use_module/2</code> directives used within object and categories. For example, the ECLiPSe IC Constraint Solvers defines a <code>::/2</code> variable domain operator that clashes with the Logtalk <code>::/2</code> message sending operator. We can solve the conflict by writing: 
     230</p> 
     231<pre>:- use_module(ic, [alldifferent/1, (::)/2:ins/2, (#=)/2]).</pre> 
     232<p> 
     233With this directive, calls to the <code>ins/2</code> predicate alias will be automatically compiled by Logtalk to calls to the <code>::/2</code> predicate in the <code>ic</code> module. 
     234</p> 
    228235 
    229236<div class="footer"> 
    230237    <div class="copyright"> 
    231238        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    232         <span>Last updated on: July 31, 2008</span> 
     239        <span>Last updated on: August 16, 2008</span> 
    233240    </div> 
    234241    <div class="navbottom">