Updated by
Deleted
SARL-FAQ- Ignore whitespace
-This is a collection of questions/issues that arose from my teaching of Agent Oriented Programming, where I have assessments in [SARL](http://www.sarl.io/) and [SWI Prolog](http://www.swi-prolog.org/), all packaged with [Apache Maven](https://maven.apache.org/).
-Because it uses and builts on [XTEND](https://www.eclipse.org/xtend/documentation/203_xtend_expressions.html) framework.
-* In **Windows**, it is easy as you can click to install JPL Java<-->SWI interface at installation time.
-* In **Linux**, you need to make sure `libjpl.so` and `jpl.jar` are somewhere! If you cannot find it, then you may need to install JPL.
- * In ARCH, you can generate it and install it using AUR package builder and `swi-prolog-git` package. Running the default PKG build file is enough to get JPL installed.
- * In MAC, we don't know how to make it work, as there is a glitch in one of the packages built for Mac... :-( [if you make it work, please let me know!]
-You may also refer to the instructions of the [SARL Prolog Capacity](https://bitbucket.org/ssardina-research/sarl-prolog-cap)
-We know that `occurrence` is static, so cannot be changed. However, in the above code, `occurrence.car`, is not being changed/assigned, but just used to refer to another entity where assignment is performed.
-However, SARL compiler will think that you are changing static element `occurrence` and complain with error. Instead do this:
-Presumably yes, but I was not yet successful (have not tried much though!). Check this post: <https://groups.google.com/forum/#!topic/sarl/E_mhpFWyBFo>
-Use `setLogLevel()` as explained here: <http://www.sarl.io/docs/official/reference/bic/Logging.html>
-There used to be a bug in that `debug()` was passed to the system logging which if it was at level `INFO` it would not display it.
-An event `AgentSpawned` will be emitted when an agent has been created and can be handled, say by a coordinator, to know the agent is now alive! Fo example:
-* `a != b` becomes `!Objects.equals(a,b)`. This is null-safe (part of Google API) and the code of the function is `a == b || (a != null && a.equals(b))`
-It is always better to test valid against null with the `===` or `!==` operators. These operators are not replaced neither `operator_equals` nor `operator_notEquals` within the Java code.
-* Java’s identity equals semantic is mapped to the tripple-equals operators `===` and `!==` in Xtend.
-Check xtend doc [here](https://www.eclipse.org/xtend/documentation/203_xtend_expressions.html#operators) for more details and SARL doc [here](http://www.sarl.io/docs/official/reference/general/Operators.html#3-comparison-operators).
-_**Note from SARL developer**_: SARL extends a part of [Xtend dialect](https://www.eclipse.org/xtend/index.html) in order to have benefits of several background features, such as the validation tests for type inheritance. Since Xtend and SARL uses [Xbase](https://www.eclipse.org/Xtext/documentation/305_xbase.html#xbase-expressions), a large part of the syntax is the same, especially within the blocks of code. (The rest of the syntax is defined in parallel. SARL was inspired by languages such as Scala, Python and Ruby. Several bugs or incoherencies of Xtend are fixed in SARL.
-There is still a bit of an issue inside the Xbase library; check this <https://github.com/sarl/sarl/issues/852#issuecomment-420842088>
-Java comes with a `Pair<A,B>` class to build an object for storing two values, nicknamed "key" and "value", but they have no meaning as key/value. It comes useful when a method has to return two values instead of just one. For example, the following function returns the next floor and direction that an elevator has to serve:
-As of Java 8, and as part of JavaFX, Java provides this `Pair<A,B>` class; check [here](https://www.geeksforgeeks.org/pair-class-in-java/) and [here](https://docs.oracle.com/javase/8/javafx/api/javafx/util/Pair.html).
-Note `Pairs` are different from `Map`, which can be seen as a collection of `Pairs` and with a proper key/value semantics.
-There exist more advanced implementations of `Pair`, for example from Apache. See [here](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/tuple/package-summary.html), [here](https://www.baeldung.com/java-pairs) and [here](https://gangmax.me/blog/2017/10/10/how-to-return-multiple-values-from-a-java-method/).
-SARL itself have compact syntax do deal with `Pair`, by using `a -> b` to create a `Pair` object `(a,b)`. There are also compact ways of manipulating `Collection` and `Maps`.
-Check SARL documentation on that [here](http://www.sarl.io/docs/official/reference/general/Operators.html#8-collection-operators).
Added
SARL-FAQ.markdown- Ignore whitespace
+This is a collection of questions/issues that arose from my teaching of Agent Oriented Programming, where I have assessments in [SARL](http://www.sarl.io/) and [SWI Prolog](http://www.swi-prolog.org/), all packaged with [Apache Maven](https://maven.apache.org/).
+Because it uses and builts on [XTEND](https://www.eclipse.org/xtend/documentation/203_xtend_expressions.html) framework.
+* In **Windows**, it is easy as you can click to install JPL Java<-->SWI interface at installation time.
+* In **Linux**, you need to make sure `libjpl.so` and `jpl.jar` are somewhere! If you cannot find it, then you may need to install JPL.
+ * In ARCH, you can generate it and install it using AUR package builder and `swi-prolog-git` package. Running the default PKG build file is enough to get JPL installed.
+ * In MAC, we don't know how to make it work, as there is a glitch in one of the packages built for Mac... :-( [if you make it work, please let me know!]
+You may also refer to the instructions of the [SARL Prolog Capacity](https://bitbucket.org/ssardina-research/sarl-prolog-cap)
+We know that `occurrence` is static, so cannot be changed. However, in the above code, `occurrence.car`, is not being changed/assigned, but just used to refer to another entity where assignment is performed.
+However, SARL compiler will think that you are changing static element `occurrence` and complain with error. Instead do this:
+Presumably yes, but I was not yet successful (have not tried much though!). Check this post: <https://groups.google.com/forum/#!topic/sarl/E_mhpFWyBFo>
+Use `setLogLevel()` as explained here: <http://www.sarl.io/docs/official/reference/bic/Logging.html>
+There used to be a bug in that `debug()` was passed to the system logging which if it was at level `INFO` it would not display it.
+An event `AgentSpawned` will be emitted when an agent has been created and can be handled, say by a coordinator, to know the agent is now alive! Fo example:
+* `a != b` becomes `!Objects.equals(a,b)`. This is null-safe (part of Google API) and the code of the function is `a == b || (a != null && a.equals(b))`
+It is always better to test valid against null with the `===` or `!==` operators. These operators are not replaced neither `operator_equals` nor `operator_notEquals` within the Java code.
+* Java’s identity equals semantic is mapped to the tripple-equals operators `===` and `!==` in Xtend.
+Check xtend doc [here](https://www.eclipse.org/xtend/documentation/203_xtend_expressions.html#operators) for more details and SARL doc [here](http://www.sarl.io/docs/official/reference/general/Operators.html#3-comparison-operators).
+_**Note from SARL developer**_: SARL extends a part of [Xtend dialect](https://www.eclipse.org/xtend/index.html) in order to have benefits of several background features, such as the validation tests for type inheritance. Since Xtend and SARL uses [Xbase](https://www.eclipse.org/Xtext/documentation/305_xbase.html#xbase-expressions), a large part of the syntax is the same, especially within the blocks of code. (The rest of the syntax is defined in parallel. SARL was inspired by languages such as Scala, Python and Ruby. Several bugs or incoherencies of Xtend are fixed in SARL.
+There is still a bit of an issue inside the Xbase library; check this <https://github.com/sarl/sarl/issues/852#issuecomment-420842088>
+Java comes with a `Pair<A,B>` class to build an object for storing two values, nicknamed "key" and "value", but they have no meaning as key/value. It comes useful when a method has to return two values instead of just one. For example, the following function returns the next floor and direction that an elevator has to serve:
+As of Java 8, and as part of JavaFX, Java provides this `Pair<A,B>` class; check [here](https://www.geeksforgeeks.org/pair-class-in-java/) and [here](https://docs.oracle.com/javase/8/javafx/api/javafx/util/Pair.html).
+Note `Pairs` are different from `Map`, which can be seen as a collection of `Pairs` and with a proper key/value semantics.
+There exist more advanced implementations of `Pair`, for example from Apache. See [here](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/tuple/package-summary.html), [here](https://www.baeldung.com/java-pairs) and [here](https://gangmax.me/blog/2017/10/10/how-to-return-multiple-values-from-a-java-method/).
+SARL itself have compact syntax do deal with `Pair`, by using `a -> b` to create a `Pair` object `(a,b)`. There are also compact ways of manipulating `Collection` and `Maps`.
+Check SARL documentation on that [here](http://www.sarl.io/docs/official/reference/general/Operators.html#8-collection-operators).