I’m reading the docs and I came across something c...
# getting-started
j
I’m reading the docs and I came across something called infix function. Is this something like a type setted function? In Java a function is always given a type whether it’d be a data type or just void. Is it similar to the concept that I mentioned?
l
An infix function is just a function where instead of writing
a.or(b)
, you can write
a or b
. It’s just syntactic sugar.
1
Infix functions still return a type. They just change how the method is written when it is called.
j
Ah I see alright
s
It's useful to write a DSL. (so are lambdas with receivers)