| 1 | ================================================================= |
|---|
| 2 | Logtalk - Object oriented extension to Prolog |
|---|
| 3 | Release 2.29.1 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved. |
|---|
| 6 | ================================================================= |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | Quick start |
|---|
| 10 | =========== |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | 1. Install Logtalk by using either the installer provided for your |
|---|
| 14 | operating-system (when available) or by following the instructions |
|---|
| 15 | on the "INSTALL" file. Depending on your operating-system, working |
|---|
| 16 | environment, and favorite Prolog compiler, you may already have a |
|---|
| 17 | script or a shortcut installed for easily running Logtalk with your |
|---|
| 18 | favorite Prolog compiler. If so, skip the instructions below for |
|---|
| 19 | starting up Logtalk. |
|---|
| 20 | |
|---|
| 21 | 2. Open the "manuals/index.html" file with a web browser. |
|---|
| 22 | |
|---|
| 23 | 3. Select the "Tutorial" link. This will provide you with a basic |
|---|
| 24 | understanding of the main Logtalk concepts. |
|---|
| 25 | |
|---|
| 26 | 4. Go back to the "index.html" file and select the "User Manual" |
|---|
| 27 | link and then the Installing and running Logtalk links. This will |
|---|
| 28 | provide you with a basic understanding of how to start Logtalk and |
|---|
| 29 | compile and load Logtalk code. |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | Assuming that Logtalk supports your Prolog compiler: |
|---|
| 33 | |
|---|
| 34 | 1. Read the "NOTES" file in the "configs" sub-directory to check if |
|---|
| 35 | any patch or workaround is needed for your compiler. |
|---|
| 36 | |
|---|
| 37 | 2. Start your Prolog compiler. |
|---|
| 38 | |
|---|
| 39 | 3. Change the current working directory of your Prolog session to the |
|---|
| 40 | Logtalk installation directory. If you don't know which predicate to |
|---|
| 41 | use, check the "configs/NOTES" file or your Prolog compiler reference |
|---|
| 42 | manual. |
|---|
| 43 | |
|---|
| 44 | 4. Compile and load the config file for your Prolog compiler. |
|---|
| 45 | |
|---|
| 46 | 5. Compile and load the Logtalk compiler/runtime found on the "compiler" |
|---|
| 47 | sub-directory. |
|---|
| 48 | |
|---|
| 49 | 6. Adapt, if needed, the file "libpaths/libpaths.pl" to match your Logtalk |
|---|
| 50 | installation, Prolog compiler, and operating-system, and then compile and |
|---|
| 51 | load it. |
|---|
| 52 | |
|---|
| 53 | Note that both the configuration files, the compiler/runtime files, and the |
|---|
| 54 | library paths file are Prolog files. The predicate used to load these files |
|---|
| 55 | depends on your Prolog compiler (consult your Prolog compiler documentation |
|---|
| 56 | or take a look at the definition of the predicate '$lgt_load_prolog_code'/1 |
|---|
| 57 | in the config file. For most command-line compilers, you could type at the |
|---|
| 58 | Prolog prompt something like: |
|---|
| 59 | |
|---|
| 60 | | ?- ['configs/foo.config', 'compiler/logtalk.pl', 'libpaths/libpaths.pl']. |
|---|
| 61 | |
|---|
| 62 | Replace the file name foo.config with the appropriated config file name for |
|---|
| 63 | your compiler. |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | Now you may try some of the included examples: |
|---|
| 67 | |
|---|
| 68 | 1. Open the examples sub-directory. There you find several sub-directories |
|---|
| 69 | with ready to run examples and a NOTES file containing general instructions |
|---|
| 70 | and a brief description of each example. Select and open one of the examples |
|---|
| 71 | sub-directory. |
|---|
| 72 | |
|---|
| 73 | 2. Read the example NOTES file for a description of the example. |
|---|
| 74 | |
|---|
| 75 | 3. Open the SCRIPT file for instructions on how to load the example and for |
|---|
| 76 | sample queries that you may try by copying-and-pasting or dragging-and-droping |
|---|
| 77 | them on your Prolog interpreter top-level. |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | Ready to start writing your own programs? |
|---|
| 81 | |
|---|
| 82 | 1. Read the User Manual sections on "Programming in Logtalk" and "Running |
|---|
| 83 | and debugging Logtalk programs". |
|---|
| 84 | |
|---|
| 85 | 2. Take a look at the "wenv" sub-directory. There you will find syntax |
|---|
| 86 | configuration files for popular text editors that enable syntax coloring |
|---|
| 87 | and other goodies when editing Logtalk source files. |
|---|
| 88 | |
|---|
| 89 | 3. Create a sub-directory with a suitable name to hold all the files of |
|---|
| 90 | your application. You may want to add the directory path to the libpaths.pl |
|---|
| 91 | file mentioned above in order to easily load your application. |
|---|
| 92 | |
|---|
| 93 | 4. Copy to this sub-directory a loader file from one of the example |
|---|
| 94 | directories and modify it to load your own source files. |
|---|
| 95 | |
|---|
| 96 | 5. Have fun! |
|---|