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