Skip to content

Commit

Permalink
Implementation of the overriding of the cast operator.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 27, 2018
1 parent b1f3c85 commit 0b602a1
Show file tree
Hide file tree
Showing 138 changed files with 47,235 additions and 37,311 deletions.
Expand Up @@ -33,31 +33,31 @@ public class SARLFeatureAccess {

/** Internal id for the agent type.
*/
public static final int SARL_AGENT = 18;
public static final int SARL_AGENT = 19;

/** Internal id for the event type.
*/
public static final int SARL_EVENT = 15;

/** Internal id for the behavior type.
*/
public static final int SARL_BEHAVIOR = 20;
public static final int SARL_BEHAVIOR = 21;

/** Internal id for the capacity type.
*/
public static final int SARL_CAPACITY = 19;
public static final int SARL_CAPACITY = 20;

/** Internal id for the skill type.
*/
public static final int SARL_SKILL = 21;
public static final int SARL_SKILL = 22;

/** Internal id for the space type.
*/
public static final int SARL_SPACE = 16;
public static final int SARL_SPACE = 17;

/** Internal id for the artifact type.
*/
public static final int SARL_ARTIFACT = 17;
public static final int SARL_ARTIFACT = 18;

/** The "def" keyword.
*
Expand Down
Expand Up @@ -14,13 +14,13 @@ agent-oriented paradigm holds the keys to effectively meet this challenge.

Syntactically and semantically SARL has its roots in the Java programming language but improves on many aspects:

* [Agent specific statements](../index.md#5-2-agent-oriented-programming) - provide specific statements for agent programming
* [Agent specific statements](../index.md#agent-oriented-programming) - provide specific statements for agent programming
* [Type inference](../reference/GeneralSyntax.md) - you rarely need to write down type signatures anymore
* [Lambda expressions](../reference/general/Lambda.md) - concise syntax for anonymous function literals
* [Operator overloading](../reference/general/Operators.md) - make your libraries even more expressive
* [Extension methods](../reference/general/Extension.md) - enhance closed types with new functionality
* [Powerful switch expressions](../reference/general/SwitchExpression.md) - type based switching with implicit casts
* [No statements](../reference/GeneralSyntax.md#4-details-on-the-sarl-language-elements) - everything is an expression
* [No statements](../reference/GeneralSyntax.md#details-on-the-sarl-language-elements) - everything is an expression
* Full support for Java generics - including all conformance and conversion rules
* Translates to Java not bytecode - understand what is going on and use your code for platforms such as Android or GWT

Expand All @@ -29,7 +29,7 @@ Unlike other JVM languages, SARL has zero interoperability issues with Java: eve
__The language is platform- and architecture-independent.__

For a brief comparison between SARL, Java and Xtend languages, see the Section
"[Comparison between SARL and other languages](../reference/OOP.md#1-comparison-between-sarl-and-other-languages)".
"[Comparison between SARL and other languages](../reference/OOP.md#comparison-between-sarl-and-other-languages)".


### Can I use SARL to make agent-based software?
Expand Down
Expand Up @@ -14,7 +14,7 @@ Three methods could be used for launching an agent with Janus:



## Use the [:januscmd!] command-line tool
## Use the Janus command-line tool

The SARL project provides a [command-line tool for launching agents](../tools/Janus.md) on the Janus runtime environment.

Expand Down
Expand Up @@ -419,7 +419,7 @@ its behavior. The [:overridemodifier:] keyword is specified for clearly marking
implementation of [:getfullnamefct:] as an override of the parent's implementation.

<note>The return type of the [:getfullnamefct:] method (called with the name [:fullnamefct:],
according to the [property access syntax](./general/MemberAccess.md#1-property-syntax))
according to the [property access syntax](./general/MemberAccess.md#property-syntax))
is not specified in the overriding prototype since it could be inferred by the SARL compiler.</note>

For preventing a function to be overridden, you should add the [:finalmodifier:] modifier in the signature of
Expand Down Expand Up @@ -1194,7 +1194,7 @@ Method calls are bound based on the static types of arguments.
Sometimes this is not what you want. Especially in the context of extension methods
you would like to have polymorphic behavior.

The [:dispatchmodifier:] modifier permits defining a [dispatch method](./general/FuncDecls.md#7-dispatch-function).
The [:dispatchmodifier:] modifier permits defining a [dispatch method](./general/FuncDecls.md#dispatch-function).
For a set of visible dispatch methods in the current type hierarchy with the same name and
the same number of arguments, the compiler infers a synthetic dispatcher method.
This dispatcher uses the common super type of all declared arguments.
Expand Down

0 comments on commit 0b602a1

Please sign in to comment.