Announcing Jactl 2.3.0
Jactl 2.3.0 is a new release with enhancements and bug fixes.
Due to a missing announcement for release 2.2.0, this release note includes enhancements and bug fixes that were done in 2.2.0 and in 2.3.0.
Enhancements for 2.3.0
#91 Infinite loop detection
Added the ability to configure a limit for total number of loop iterations and to configure a timeout for script executions.
Bug Fixes for 2.3.0
- #86 Unescaped trailing backslash error when running on Windows
- #87 Gradle build fails due to missing properties
- #88 Publishing to Maven Local fails do to “no configured signatory” error
Enhancements for 2.2.0
#71 Support arbitrary types as Map keys
Previously, Jactl only supported Strings as keys in maps. Now, any type can be used as a key.
#72 Support if/unless expressions in action of switch expressions
In the action of a switch case it was no possible to use if
or unless
expressions.
This is now supported.
For example, this now works:
switch(x) {
/count=(\d*) sum=(\d*)/n -> $2/$1 unless $1 == 0
}
#74 Support use of constant expression strings in switch patterns
Patterns in switch expressions can now be expressions strings if the string is a constant.
For example, this used to fail because "xyx"
was considered a non-constant expression previously:
switch(x) {
"xyz" -> 'found'
}
#76 Comma separated indices for indexing multi-dimensional arrays
Jactl now allows the use of commas for indexing into a multidimensional array as well. For example, these two expressions are the same:
values[x][y]
values[x,y]
#78 DefaultEnv now has shutdown method for cleaning up thread pools
For clean shutdown of an application, the DefaultEnv
object now has a shutdown()
method to clean up
its thread pools.
#82 Add ability for different JactlContexts to have different sets of custom function/methods
For applications that use Jactl scripts, there could be different types of scripts used in different parts of the application. It may make sense to therefore have different sets of custom functions available to the different script types.
Jactl now provides a way to attach custom functions to individual JactlContext
objects that are used when
compiling scripts so that the different script types can use the relevant JactlContext
and thus get different
sets of custom functions.
Bug Fixes for 2.2.0
- #73 Erroneous error in switch expression when using ‘if’ in pattern
- #75 Break/continue with a label inside a while loop generates NullPointerException
- #77 Parsing error when list appears as first item on line after a type name
- #79 Fixed internal compile error “could not find static method castToNumber”
- #81 Conditional assignment with ?= fails for bit operations if operand is null