Releases: tambapps/marcel
Releases · tambapps/marcel
1.1
1.0
Release note
Function call without parenthesis
When calling functions, you can now omit the parenthesis, like in Groovy
println "Without parenthesis" // println("Without parenthesis")
println fibonacci 10 // println(fibonacci(10))Iterable operations
Implemented a new syntax to perform common operations on Iterables.
list<int> list = [1, 2, 3, 4]
list<int> list2 = [for int i in list -> i + 1] // map -> [2, 3, 4, 5]
list<float> list2 = [for int i in list -> i + 0.1f if i <= 2] // map and filter -> [1.1f, 2.2f]
println(when int a in list |> a >= 3) // any -> true
println(when int a in list &> a >= 3) // all -> false
println(!when int a in list |> a >= 3) // not any -> false
println(!when int a in list &> a >= 3) // not all -> true
println(when int a in list -> a % 2 == 0) // find -> 2
println(when int a in list -> a % 2 == 5) // find -> nullFull documentation here
Marcel for Android
the Marcel for Android app has been redeveloped from scratch, offering a much better UI.
0.1.1
0.1.0
Today, the 11th of January 2024 is Marcel's birthday!
This new release brings a whole new clean implementation of Marcel Lang. It also provides new features and bugfixes
Do while
int i = 15
do {
println(i++)
} while (i < 10)Full doc here.
Iterating over maps
Map m = [foo: 1, bar: 2]
for ((String key, int value) in m) println("$key=$value")Full doc here.
Single statement functions
fun int sum(int a, int b) -> a + bFull doc here
Varargs method calls
You can now call varags method as you would in Java
String.join(",", "s1", "s2") == String.join(",", ["s1", "s2"] as CharSequence[])
String.join(",") == String.join(",", [] as CharSequence[])Meta annotations
Marcel now brings in its standard library useful annotations allowing to generate boiler-plate code (see full doc here)
it provides 3 meta-annotations
@stringifywhich autogenerates an object'stoStringmethod based on its properties@datawhich autogenerates theequalsandhashCodemethods based on the object's properties@comparablewhich makes the object implement Comparable and use its properties to make the comparison@lazywhich makes the annotated property lazy (lazy initialization)@cachedwhich caches the results of the annotated method using the method arguments as the cache key