Logtalk release 2.14.1 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@561 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
<!doctype html public "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<?xml-stylesheet type="text/css" href="../styles.css" ?>
|
||||
|
||||
<html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
|
||||
<head>
|
||||
<title>List predicates</title>
|
||||
<link rel=stylesheet href="../styles.css" type="text/css">
|
||||
<link rel="stylesheet" href="../styles.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -68,7 +71,7 @@ We will start by defining an object, <code>list</code>, containing predicate def
|
||||
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.
|
||||
</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:
|
||||
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:
|
||||
</p>
|
||||
<pre>
|
||||
| ?- logtalk_load([list]).
|
||||
@@ -197,7 +200,7 @@ The protocol declared in <code>listp</code> may now be alternatively implemented
|
||||
<strong><a href="index.html">Previous</a> | <a href="attributes.html">Next</a> | <a href="index.html">Table of Contents</a> | <a href="../bibliography.html">Bibliography</a> | <a href="../glossary.html">Glossary</a></strong>
|
||||
</p>
|
||||
<p class="center">
|
||||
Last updated on: October 1, 2000
|
||||
Last updated on: July 29, 2002
|
||||
</p>
|
||||
<hr />
|
||||
|
||||
|
Reference in New Issue
Block a user