2001-06-06 20:40:57 +01:00
|
|
|
=================================================================
|
|
|
|
Logtalk - Object oriented extension to Prolog
|
2007-03-28 23:44:31 +01:00
|
|
|
Release 2.29.5
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2007-01-10 12:46:10 +00:00
|
|
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
2001-06-06 20:40:57 +01:00
|
|
|
=================================================================
|
|
|
|
|
|
|
|
|
|
|
|
Quick start
|
|
|
|
===========
|
|
|
|
|
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
Starting up Logtalk
|
|
|
|
-------------------
|
|
|
|
|
2006-12-28 13:03:34 +00:00
|
|
|
1. Install Logtalk by using either the installer provided for your
|
|
|
|
operating-system (when available) or by following the instructions
|
2007-03-28 23:44:31 +01:00
|
|
|
on the "INSTALL.txt" file. Depending on your operating-system, working
|
2006-12-28 13:03:34 +00:00
|
|
|
environment, and favorite Prolog compiler, you may already have a
|
|
|
|
script or a shortcut installed for easily running Logtalk with your
|
2007-03-28 23:44:31 +01:00
|
|
|
favorite Prolog compiler. In this case, skip the instructions below
|
|
|
|
for starting up Logtalk and go straight to the instructions on running
|
|
|
|
the examples.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
2. Open the "manuals/index.html" file with a web browser.
|
|
|
|
|
2006-12-28 13:03:34 +00:00
|
|
|
3. Select the "Tutorial" link. This will provide you with a basic
|
|
|
|
understanding of the main Logtalk concepts.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
4. Go back to the "index.html" file, select the "User Manual" link,
|
|
|
|
then the "Installing Logtalk" and "Running and debugging Logtalk
|
|
|
|
programs" links. This will provide you with a basic understanding of
|
|
|
|
how to start Logtalk as well as how to compile and load Logtalk code.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
Assuming that Logtalk supports your Prolog compiler:
|
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
1. Read the "NOTES.txt" file in the "configs" sub-directory to check if
|
2006-12-28 13:03:34 +00:00
|
|
|
any patch or workaround is needed for your compiler.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
|
|
|
2. Start your Prolog compiler.
|
|
|
|
|
2006-12-28 13:03:34 +00:00
|
|
|
3. Change the current working directory of your Prolog session to the
|
|
|
|
Logtalk installation directory. If you don't know which predicate to
|
2007-03-28 23:44:31 +01:00
|
|
|
use, check the "configs/NOTES.txt" file or your Prolog compiler reference
|
2006-12-28 13:03:34 +00:00
|
|
|
manual.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2004-06-13 19:04:28 +01:00
|
|
|
4. Compile and load the config file for your Prolog compiler.
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
5. Compile and load the Logtalk compiler/runtime found on the "compiler"
|
2001-06-06 20:40:57 +01:00
|
|
|
sub-directory.
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
6. Adapt, if needed, the file "libpaths/libpaths.pl" to match your Logtalk
|
2007-03-28 23:44:31 +01:00
|
|
|
installation, Prolog compiler, operating-system, and then compile and
|
2004-11-29 20:36:31 +00:00
|
|
|
load it.
|
|
|
|
|
|
|
|
Note that both the configuration files, the compiler/runtime files, and the
|
|
|
|
library paths file are Prolog files. The predicate used to load these files
|
|
|
|
depends on your Prolog compiler (consult your Prolog compiler documentation
|
|
|
|
or take a look at the definition of the predicate '$lgt_load_prolog_code'/1
|
|
|
|
in the config file. For most command-line compilers, you could type at the
|
|
|
|
Prolog prompt something like:
|
2004-06-13 19:04:28 +01:00
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
| ?- ['configs/foo.config', 'compiler/logtalk.pl', 'libpaths/libpaths.pl'].
|
2004-06-13 19:04:28 +01:00
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
Replace the file name "foo.config" with the appropriate config file name for
|
2004-06-13 19:04:28 +01:00
|
|
|
your compiler.
|
|
|
|
|
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
Running the examples
|
|
|
|
--------------------
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
You may now try some of the provided examples:
|
|
|
|
|
|
|
|
1. Open the "examples" sub-directory. There you find several sub-directories
|
|
|
|
with ready to run examples and a "NOTES.txt" file containing general
|
|
|
|
instructions and a brief description of each example. Select and open one
|
|
|
|
of the examples sub-directory.
|
|
|
|
|
|
|
|
2. Read the example "NOTES.txt" file for a description of the example.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
3. Open the "SCRIPT.txt" file for instructions on how to load the example
|
|
|
|
and for sample queries that you may try by copying-and-pasting them to
|
|
|
|
your Prolog interpreter top-level.
|
2001-06-06 20:40:57 +01:00
|
|
|
|
2002-05-28 12:29:37 +01:00
|
|
|
|
2007-03-28 23:44:31 +01:00
|
|
|
Writing your own programs
|
|
|
|
_________________________
|
2002-05-28 12:29:37 +01:00
|
|
|
|
|
|
|
Ready to start writing your own programs?
|
|
|
|
|
2006-12-28 13:03:34 +00:00
|
|
|
1. Read the User Manual sections on "Programming in Logtalk" and "Running
|
|
|
|
and debugging Logtalk programs".
|
2004-06-13 19:04:28 +01:00
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
2. Take a look at the "wenv" sub-directory. There you will find syntax
|
2007-03-28 23:44:31 +01:00
|
|
|
configuration files for popular text editors which enable syntax coloring
|
|
|
|
and other text services when editing Logtalk source files.
|
2002-05-28 12:29:37 +01:00
|
|
|
|
2006-12-28 13:03:34 +00:00
|
|
|
3. Create a sub-directory with a suitable name to hold all the files of
|
2007-03-28 23:44:31 +01:00
|
|
|
your application. You may want to add the directory path to the "libpaths.pl"
|
2006-12-28 13:03:34 +00:00
|
|
|
file mentioned above in order to easily load your application.
|
2002-05-28 12:29:37 +01:00
|
|
|
|
2006-12-28 13:03:34 +00:00
|
|
|
4. Copy to this sub-directory a loader file from one of the example
|
|
|
|
directories and modify it to load your own source files.
|
2004-06-13 19:04:28 +01:00
|
|
|
|
|
|
|
5. Have fun!
|