Logtalk 2.14.6 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@735 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -68,7 +68,7 @@ We will start by defining an object, <code>list</code>, containing predicate def
|
||||
:- end_object.
|
||||
</pre>
|
||||
<p>
|
||||
What is different here from a regular Prolog program? The definitions of the list predicates are the usual ones. We have two new directives, <a title="Consult reference manual" href="../refman/directives/object1_4.html"><code>object/1</code></a> and <a title="Consult reference manual" href="../refman/directives/end_object0.html"><code>end_object/0</code></a>, that encapsulate the object's code. In Logtalk, by default, all object predicates are private; therefore, we have to explicitly declare all predicates that we want to be public, that is, that we want to call from outside the object. This is done using the <a title="Consult reference manual" href="../refman/directives/public1.html"><code>public/1</code></a> scope directive.
|
||||
What is different here from a regular Prolog program? The definitions of the list predicates are the usual ones. We have two new directives, <a title="Consult reference manual" href="../refman/directives/object1_5.html"><code>object/1</code></a> and <a title="Consult reference manual" href="../refman/directives/end_object0.html"><code>end_object/0</code></a>, that encapsulate the object's code. In Logtalk, by default, all object predicates are private; therefore, we have to explicitly declare all predicates that we want to be public, that is, that we want to call from outside the object. This is done using the <a title="Consult reference manual" href="../refman/directives/public1.html"><code>public/1</code></a> scope directive.
|
||||
</p>
|
||||
<p>
|
||||
After we copy the object code to a text file and saved it under the name <code>list.lgt</code>, we need to change the Prolog working directory to the one used to save our file (consult your Prolog compiler reference manual). Then, after starting Logtalk (see the <a title="Consult user manual" href="../userman/installing.html#running">Installing and running Logtalk</a> session on the User Manual), we can compile and load the object using the <a title="Consult reference manual" href="../refman/builtins/logtalk_load1.html"><code>logtalk_load/1</code></a> Logtalk built-in predicate:
|
||||
|
Reference in New Issue
Block a user