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