User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:09_java_addition

Additional features

Additional features in a java block

For statement

The for statement is enhanced in XL. It can take two additional type of arguments: generators and DisposableIterators.

→ Read more...

Implicit conversions

It is possible to convert object and primitive into other objects implicitly. By default, the only implicit conversions enabled are the boxing and unboxing of primitive (e.g. from Integer to int) and RGG files also automatically include the Float to Double implicit conversion.

It is possible to declare additional conversions by defining the appropriate method or constructor. However, if more that one conversion between to object is available, the conversion is ambiguous and results in an error.

→ Read more...

Modifiers

The XL language include additional modifiers which can be used when declaring variables.

→ Read more...

Operators

The XL programming language defines several new operators, including arrow operators whose main purpose is to be used within production statements and which have no built-in meaning, i. e., they always refer to operator methods. The new operators a ** b, a <=> b and `a` have a built-in semantics which is described in the following. A complete list of all operators including their precedence is given there.

→ Read more...

Overload operator

Operators can be overloaded in XL by declaring the method operator$NAME_OF_OPERATOR(var , var ){}. The list of operators in groimp is available at: xl specification.

→ Read more...

Expression list

In RGG, for Java as well as XL blocks it is possible to combine several expressions in one expression, using brackets and separating them by comma. The expressions will then be executed in order from left to right, and the last one on the right defines the return value of the surrounding expression list.

→ Read more...

XL Lambda function

Since the java version used in GroIMP does not yet support the java lambda functions, GroIMP comes with a set of own lambda functions. A Lambda function or anonymous function is a function that is not connected to an identifier and can be handled like a variable.

The XL implementation is mostly designed for mathematical or logical operations and follows a clear but strict syntax: For instance the mathematical expression f(x)=x*0.7 could be defined by this expresison: IntToFloat f = int x ⇒ float x*0.7;, This can then be used to evaluate the function for a given integer to return a float: f.evaluateFloat​(3).

→ Read more...

01_user_documentation/07_rgg_xl/02_xl/09_java_addition.txt · Last modified: 2025/08/20 10:32 by gaetan