Changeset 4278 for trunk/manuals
- Timestamp:
- 05/25/08 05:28:34 (8 months ago)
- Files:
-
- 1 modified
-
trunk/manuals/refman/builtins/create_object4.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/manuals/refman/builtins/create_object4.html
r3560 r4278 26 26 <pre>create_object(Identifier, Relations, Directives, Clauses)</pre> 27 27 <p> 28 Creates a new, dynamic , object.28 Creates 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. 29 29 </p> 30 30 … … 54 54 <h4>Examples</h4> 55 55 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 57 67 58 68 <div class="footer"> 59 69 <div class="copyright"> 60 70 <span>Copyright © <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> — <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> 62 72 </div> 63 73 <div class="navbottom">
