- Timestamp:
- 05/24/08 03:24:58 (4 months ago)
- Location:
- trunk/manuals
- Files:
-
- 3 modified
-
refman/control/direct1.html (modified) (2 diffs)
-
userman/categories.html (modified) (2 diffs)
-
userman/running.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/manuals/refman/control/direct1.html
r4271 r4272 24 24 <h4>Description</h4> 25 25 26 <pre>: Goal</pre>26 <pre>:Predicate</pre> 27 27 <p> 28 28 Calls an <strong>imported</strong> predicate with the lookup for the predicate declaration beginning in <em>this</em> instead of <em>self</em> and with the lookup for the predicate definition restricted to the imported categories. As a consequence, any redeclaration or redefinition of the predicate in a descendant of the object containing the call will be ignored. The predicate is called with the same execution context (<em>sender</em>, <em>this</em>, and <em>self</em>) as the predicate whose body contains the call. When the predicate is defined in an imported category compiled using static binding, this control construct allows the predicate to be called with the same performance as a local object predicate. … … 36 36 37 37 <dl> 38 <dt> Goalis a variable:</dt>38 <dt>Predicate is a variable:</dt> 39 39 <dd><code>instantiation_error</code></dd> 40 <dt> Goalis neither a variable nor a callable term:</dt>41 <dd><code>type_error(callable, Goal)</code></dd>42 <dt> The object containing the call does not import any category:</dt>43 <dd><code>existence_error(pr ocedure, Goal)</code></dd>40 <dt>Predicate is neither a variable nor a callable term:</dt> 41 <dd><code>type_error(callable, Predicate)</code></dd> 42 <dt>Predicate is not declared:</dt> 43 <dd><code>existence_error(predicate_declaration, Predicate)</code></dd> 44 44 </dl> 45 45 -
trunk/manuals/userman/categories.html
r4212 r4272 58 58 :- end_category.</pre> 59 59 <p> 60 This feature should only be used when extending a category without breaking its functional cohesion (for example, when a modified version of a category is needed for importing on several unrelated objects). The prefer ed way of composing several categories is by importing them into an object.60 This feature should only be used when extending a category without breaking its functional cohesion (for example, when a modified version of a category is needed for importing on several unrelated objects). The preferred way of composing several categories is by importing them into an object. When a category overrides a predicate defined in an extended category, the overridden definition can still be used by using the <a title="Consult reference manual" href="../refman/directives/alias3.html"><code>alias/3</code></a> predicate directive. 61 61 </p> 62 62 <p> … … 330 330 </p> 331 331 <p> 332 It is also possible to call category predicates such that the predicate declaration and definition lookups will start from <em>this</em> instead of <em>self</em> by usingthe <a title="Consult reference manual" href="../refman/control/direct1.html"><code>:/1</code></a> control construct. For example:332 It is also possible to perform direct calls to predicates from imported categories without using the message sending mechanisms with the <a title="Consult reference manual" href="../refman/control/direct1.html"><code>:/1</code></a> control construct. For example: 333 333 </p> 334 334 <pre>:- object(worker, -
trunk/manuals/userman/running.html
r4213 r4272 182 182 <dl> 183 183 <dt><code>hook(Object)</code></dt> 184 <dd>Allows the definition of acompiler hooks that are called for each term read form a source file and for each compiled goal. This option specifies an object (which can be the pseudo-object <code>user</code>) implementing the <code>expanding</code> built-in protocol. The object is expected to define clauses for the <a title="Consult reference manual" href="../refman/methods/term_expansion2.html"><code>term_expansion/2</code></a> and <a title="Consult reference manual" href="../refman/methods/goal_expansion2.html"><code>goal_expansion/2</code></a> predicates. In the case of the <code>term_expansion/2</code> predicate, the first argument is the term read form the source file while the second argument returns a list of terms corresponding to the expansion of the first argument. In the case of the <code>goal_expansion/2</code> predicate, the second argument should be a goal resulting from the expansion of the goal in the first argument. The predicate <code>goal_expansion/2</code> is called on the expanded goals so care must be taken to avoid compilation loops.</dd>184 <dd>Allows the definition of compiler hooks that are called for each term read form a source file and for each compiled goal. This option specifies an object (which can be the pseudo-object <code>user</code>) implementing the <code>expanding</code> built-in protocol. The object is expected to define clauses for the <a title="Consult reference manual" href="../refman/methods/term_expansion2.html"><code>term_expansion/2</code></a> and <a title="Consult reference manual" href="../refman/methods/goal_expansion2.html"><code>goal_expansion/2</code></a> predicates. In the case of the <code>term_expansion/2</code> predicate, the first argument is the term read form the source file while the second argument returns a list of terms corresponding to the expansion of the first argument. In the case of the <code>goal_expansion/2</code> predicate, the second argument should be a goal resulting from the expansion of the goal in the first argument. The predicate <code>goal_expansion/2</code> is called on the expanded goals so care must be taken to avoid compilation loops.</dd> 185 185 </dl> 186 186 <dl>
