summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--it-it/logtalk-it.html.markdown12
-rw-r--r--logtalk.html.markdown14
2 files changed, 19 insertions, 7 deletions
diff --git a/it-it/logtalk-it.html.markdown b/it-it/logtalk-it.html.markdown
index dfb9cd27..4fbf2d10 100644
--- a/it-it/logtalk-it.html.markdown
+++ b/it-it/logtalk-it.html.markdown
@@ -379,6 +379,9 @@ Se il codice sorgente dell'oggetto non è disponibile e bisogna correggere l'app
Dopo la compilazione e il caricamento della categoria nell'applicazione in esecuzione si ottiene:
```logtalk
+?- set_logtalk_flag(complements, allow).
+yes
+
?- {patch}.
yes
@@ -387,7 +390,7 @@ bar
yes
```
-Poiché l'hot-patching pregiudica forzatamente l'incapsulamento, un apposito flag di compilazione `complementary` può essere impostato (a livello globale o per un singolo oggetto) per consentire, limitare o prevenire l'hot-patching.
+Poiché l'hot-patching interrompe forzatamente l'incapsulamento, è possibile impostare il flag del compilatore `complementary` può essere impostato (a livello globale o per un singolo oggetto) per consentire, limitare o prevenire l'hot-patching.
# Oggetti Parametrici e Categorie
@@ -463,6 +466,9 @@ Logtalk supporta l'_event-driven programming_ mediante la definizione di eventi
Supponendo che l'oggetto `tracer` e l'oggetto `list` definito in precedenza siano stati già compilati e caricati, si possono osservare i gestori di eventi in azione durante l'invio di un messaggio:
```logtalk
+?- set_logtalk_flag(events, allow).
+yes
+
?- list::member(X, [1,2,3]).
call: list <-- member(X, [1,2,3]) from user
@@ -481,11 +487,11 @@ La programmazione event-driven può essere vista come una forma di _computationa
# Espressioni lambda
-Logtalk supporta anche le espressioni lambda. I parametri della espressioni lambda sono rappresentati mediante una lista con l'operatore infisso `(>>)/2` che collega i parametri alla relativa lambda espressione. Ecco alcuni semplici esempi di che usano i meta-predicati.
+Logtalk supporta anche le espressioni lambda. I parametri della espressioni lambda sono rappresentati mediante una lista con l'operatore infisso `(>>)/2` che collega i parametri alla relativa lambda espressione. Ecco alcuni semplici esempi che utilizzano la libreria `meta`.
```logtalk
-?- {library(metapredicates_loader)}.
+?- {meta(loader)}.
yes
?- meta::map([X,Y]>>(Y is 2*X), [1,2,3], Ys).
diff --git a/logtalk.html.markdown b/logtalk.html.markdown
index ce907ee3..8c6b87dd 100644
--- a/logtalk.html.markdown
+++ b/logtalk.html.markdown
@@ -1,8 +1,8 @@
---
language: Logtalk
+filename: learnlogtalk.lgt
contributors:
- ["Paulo Moura", "http://github.com/pmoura"]
-filename: learnlogtalk.lgt
---
Logtalk is an object-oriented logic programming language that extends and leverages Prolog with modern code encapsulation and code reuse mechanisms without compromising its declarative programming features. Logtalk is implemented in highly portable code and can use most modern and standards compliant Prolog implementations as a back-end compiler.
@@ -376,6 +376,9 @@ If the object source code is not available and we need to fix an application run
After compiling and loading the category into the running application we will now get:
```logtalk
+?- set_logtalk_flag(complements, allow).
+yes
+
?- {patch}.
yes
@@ -384,7 +387,7 @@ bar
yes
```
-As hot-patching forcefully breaks encapsulation, there is a `complements` compiler flag that can be set (globally or on a per-object basis) to allow, restrict, or prevent it.
+As hot-patching forcefully breaks encapsulation, the `complements` compiler flag can be set (globally or on a per-object basis) to allow, restrict, or prevent it.
# Parametric objects and categories
@@ -460,6 +463,9 @@ Logtalk supports _event-driven programming_ by allowing defining events and moni
Assuming that the `tracer` object and the `list` object defined earlier are compiled and loaded, we can observe the event handlers in action by sending a message:
```logtalk
+?- set_logtalk_flag(events, allow).
+yes
+
?- list::member(X, [1,2,3]).
call: list <-- member(X, [1,2,3]) from user
@@ -478,10 +484,10 @@ Event-driven programming can be seen as a form of _computational reflection_. Bu
# Lambda expressions
-Logtalk supports lambda expressions. Lambda parameters are represented using a list with the `(>>)/2` infix operator connecting them to the lambda. Some simple examples using library meta-predicates:
+Logtalk supports lambda expressions. Lambda parameters are represented using a list with the `(>>)/2` infix operator connecting them to the lambda. Some simple examples using library `meta`:
```logtalk
-?- {library(metapredicates_loader)}.
+?- {meta(loader)}.
yes
?- meta::map([X,Y]>>(Y is 2*X), [1,2,3], Ys).