Changeset 4278 for trunk/manuals

Show
Ignore:
Timestamp:
05/25/08 05:28:34 (8 months ago)
Author:
pmoura
Message:

Improved documentation of the create_object/4 built-in predicate.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/manuals/refman/builtins/create_object4.html

    r3560 r4278  
    2626<pre>create_object(Identifier, Relations, Directives, Clauses)</pre> 
    2727<p> 
    28 Creates a new, dynamic, object. 
     28Creates a new, dynamic object. The word <a class="glossary" title="Go to glossary definition" href="../../glossary.html#object"><em>object</em></a> is used here as a generic term. This predicate can be used to create new prototypes, instances, and classes. This predicate is often used as a primitive to implement object creation methods.  
    2929</p> 
    3030 
     
    5454<h4>Examples</h4> 
    5555 
    56 <pre>| ?- create_object(foo, [extends(bar)], [public(foo/1)], [foo(1), foo(2)]).</pre> 
     56<dl> 
     57    <dt>Creating a simple, stand-alone object (a prototype):</dt> 
     58        <dd><code>| ?- create_object(translator, [], [public(int/2)], [int(0, zero)]).</code></dd> 
     59    <dt>Creating a new prototype derived from a parent prototype:</dt> 
     60        <dd><code>| ?- create_object(mickey, [extends(mouse)], [public(alias/1)], [alias(mortimer)]).</code></dd> 
     61    <dt>Creating a new class instance:</dt> 
     62        <dd><code>| ?- create_object(p1, [instantiates(person)], [], [name('Paulo Moura'), age(42)]).</code></dd> 
     63    <dt>Creating a new class as a specialization of another class:</dt> 
     64        <dd><code>| ?- create_object(hovercraft, [specializes(vehicle)], [propeller/2, fan/2], []).</code></dd> 
     65</dl> 
     66 
    5767 
    5868<div class="footer"> 
    5969    <div class="copyright"> 
    6070        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    61         <span>Last updated on: October 26, 2006</span> 
     71        <span>Last updated on: May 23, 2008</span> 
    6272    </div> 
    6373    <div class="navbottom">