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