summaryrefslogtreecommitdiffhomepage
path: root/logtalk.html.markdown
diff options
context:
space:
mode:
authorAndre Polykanine <ap@oire.me>2019-02-03 20:02:57 +0200
committerGitHub <noreply@github.com>2019-02-03 20:02:57 +0200
commit4315785846d0d8a85205a7af4d0a76aec51cfab8 (patch)
tree7dcbda3771c1bc06cfc4df9a2ff76fb42d9e8e48 /logtalk.html.markdown
parent96a44abb1d5832c3b7a5bded015fb721998e0a09 (diff)
parentc0d134c2d90aa03a2ab2e75389353524a46c1bb9 (diff)
Merge pull request #3460 from LogtalkDotOrg/logtalk_update
[logtalk/en,it-it] Improve section on compiling and loading source files
Diffstat (limited to 'logtalk.html.markdown')
-rw-r--r--logtalk.html.markdown7
1 files changed, 6 insertions, 1 deletions
diff --git a/logtalk.html.markdown b/logtalk.html.markdown
index 5a52bd3c..ce907ee3 100644
--- a/logtalk.html.markdown
+++ b/logtalk.html.markdown
@@ -40,7 +40,7 @@ An object encapsulates predicate declarations and definitions. Objects can be cr
:- end_object.
```
-# Compiling source files
+# Compiling and loading source files
Assuming that the code above for the `list` object is saved in a `list.lgt` file, it can be compiled and loaded using the `logtalk_load/1` built-in predicate or its abbreviation, `{}/1`, with the file path as argument (the extension can be omitted):
@@ -49,6 +49,11 @@ Assuming that the code above for the `list` object is saved in a `list.lgt` file
yes
```
+In general, entities may have dependencies on entities defined in other source files (e.g. library entities). To load a file and all its dependencies, the advised solution is to define a
+_loader_ file that loads all the necessary files for an application. A loader file is simply a source file, typically named `loader.lgt`, that makes calls to the `logtalk_load/1-2`
+built-in predicates, usually from an `initialization/1` directive for portability and
+standards compliance. Loader files are provided for all libraries, tools, and examples.
+
# Sending a message to an object
The `::/2` infix operator is used to send a message to an object. As in Prolog, we can backtrack for alternative solutions: