Changeset 4599 for trunk/manuals/refman

Show
Ignore:
Timestamp:
11/21/08 12:47:26 (7 weeks ago)
Author:
pmoura
Message:

Added an expand_goal/2 built-in method to support explicit calls to the goal_expansion/2 user-defined hook. Updated the term expansion mechanism to allow the expansion to be a single term instead of a list of terms. Improved the documentation of the term and goal expansion predicates.

Added syntax coloring support for the new expand_goal/2 method to the supported text editors and syntax highlighters.

Location:
trunk/manuals/refman
Files:
5 modified

Legend:

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

    r4577 r4599  
    294294</dl> 
    295295 
    296 <h3>Term expansion methods</h3> 
     296<h3>Term and goal expansion methods</h3> 
    297297 
    298298<dl class="toc-entries"> 
    299299    <dt><code><a href="methods/expand_term2.html">expand_term/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_expand_term2"></span></span></dt> 
    300300    <dt><code><a href="methods/term_expansion2.html">term_expansion/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_term_expansion2"></span></span></dt> 
     301    <dt><code><a href="methods/expand_goal2.html">expand_goal/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_expand_goal2"></span></span></dt> 
    301302    <dt><code><a href="methods/goal_expansion2.html">goal_expansion/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_goal_expansion2"></span></span></dt> 
    302303</dl> 
     
    333334    <div class="copyright"> 
    334335        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    335         <span>Last updated on: November 7, 2008</span> 
     336        <span>Last updated on: November 21, 2008</span> 
    336337    </div> 
    337338    <div class="navbottom"> 
  • trunk/manuals/refman/methods/expand_term2.html

    r3560 r4599  
    2929</p> 
    3030<p> 
    31 The expansion works as follows: if the first argument is a variable, then it is unified with the second argument; if the first argument is not a variable and clauses for the <code>term_expansion/2</code> predicate are within scope, then this predicate is called to provide an expansion that is then unified with the second argument; if the <code>term_expansion/2</code> predicate is not used and the first argument is a compound term with functor <code>--&gt;/2</code> then the default Logtalk grammar rule translator is used, with the resulting clause being unified with the second argument; when the translator is not used, the two arguments are unified. 
     31The expansion works as follows: if the first argument is a variable, then it is unified with the second argument; if the first argument is not a variable and clauses for the <code>term_expansion/2</code> predicate are within scope, then this predicate is called to provide an expansion that is then unified with the second argument; if the <code>term_expansion/2</code> predicate is not used and the first argument is a compound term with functor <code>--&gt;/2</code> then the default Logtalk grammar rule translator is used, with the resulting clause being unified with the second argument; when the translator is not used, the two arguments are unified. The <code>expand_term/2</code> predicate may return a list of terms. 
    3232</p> 
    3333<p> 
     
    5454    <div class="copyright"> 
    5555        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    56         <span>Last updated on: October 26, 2006</span> 
     56        <span>Last updated on: November 21, 2008</span> 
    5757    </div> 
    5858    <div class="navbottom"> 
  • trunk/manuals/refman/methods/goal_expansion2.html

    r3945 r4599  
    2626<pre>goal_expansion(Goal, ExpandedGoal)</pre> 
    2727<p> 
    28 Defines an expansion for a goal. The first argument is the goal to be expanded. The expanded goal is returned in the second argument. This predicate is called recursively on the expanded goal. Thus, care must be taken to avoid compilation loops. This predicate is called when compiling source files, when dynamically creating new objects, and when asserting predicate clauses.  
     28Defines an expansion for a goal. The first argument is the goal to be expanded. The expanded goal is returned in the second argument. This predicate is called recursively on the expanded goal. Thus, care must be taken to avoid compilation loops. This predicate, when defined, is automatically called by the <a href="expand_goal2.html"><code>expand_goal/2</code></a> method. Use of this predicate by the <code>expand_goal/2</code> method may be restricted by using a scope directive for it. This predicate is called when compiling source files, when dynamically creating new objects, and when asserting predicate clauses.  
    2929</p> 
    3030 
     
    4848    <div class="copyright"> 
    4949        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    50         <span>Last updated on: December 3, 2007</span> 
     50        <span>Last updated on: November 21, 2008</span> 
    5151    </div> 
    5252    <div class="navbottom"> 
    53         <span><a href="term_expansion2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="../index.html#methods">next</a></span><br/> 
     53        <span><a href="expand_goal2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="../index.html#methods">next</a></span><br/> 
    5454        <span><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span> 
    5555    </div> 
  • trunk/manuals/refman/methods/term_expansion2.html

    r3942 r4599  
    2626<pre>term_expansion(Term, Expansion)</pre> 
    2727<p> 
    28 Defines an expansion for a term. This predicate, when defined, is automatically called by the <a href="expand_term2.html"><code>expand_term/2</code></a> method. Use of this predicate by the <code>expand_term/2</code> method may be restricted by using a scope directive for it. The <code>term_expansion/2</code> clauses are only used by the <code>expand_term/2</code> method if they are within the scope of the <em>sender</em>. When that is not the case, the <code>expand_term/2</code> method only uses the default expansions. 
     28Defines an expansion for a term. This predicate, when defined, is automatically called by the <a href="expand_term2.html"><code>expand_term/2</code></a> method. Use of this predicate by the <code>expand_term/2</code> method may be restricted by using a scope directive for it. The <code>term_expansion/2</code> clauses are only used by the <code>expand_term/2</code> method if they are within the scope of the <em>sender</em>. When that is not the case, the <code>expand_term/2</code> method only uses the default expansions. The <code>term_expansion/2</code> predicate may return a list of terms. 
    2929</p> 
    3030 
     
    4848    <div class="copyright"> 
    4949        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    50         <span>Last updated on: October 26, 2006</span> 
     50        <span>Last updated on: November 21, 2008</span> 
    5151    </div> 
    5252    <div class="navbottom"> 
    53         <span><a href="expand_term2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="goal_expansion2.html">next</a></span><br/> 
     53        <span><a href="expand_term2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="expand_goal2.html">next</a></span><br/> 
    5454        <span><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span> 
    5555    </div> 
  • trunk/manuals/refman/refman.header

    r4575 r4599  
    3636        <span>http://logtalk.org/</span> 
    3737    </p> 
    38     <p class="date">Last updated on November 7, 2008</p> 
     38    <p class="date">Last updated on November 21, 2008</p> 
    3939</div> 
    4040