Dear Community,
to get a first impression of Kotlin I’ve started a small project to create a DSL for
the creation of LaTeX-files. I’ve worked my way through the html-example in the
documentation but I am stuck at one point: Is it possible to generate an expression
like frac{numerator}{denominator} ? I tried the following which should
- at least in theory - show the wanted behaviour:
fun frac(numerator: () -> Unit) : (denominator: () -> Unit) -> Unit
{
...
}
fun main(args : Array<String>)
{
frac{}{}
}
Kotlin gives me this error:
“Only one function literal is allowed outside a parenthesized argument list”
Any comments/ideas are appreciated!
Alexander