If you coming from C/C++ than you would be very happy to have something like pointers but in this case Kotlin have something called
Operator that unpacks an array into the list of values from the array. It is needed when you want to pass an array as the vararg parameter.
If you call format in example below
while (inputX < code.size) val arguments = arrayOf("arg1", "arg2") format(output, arguments)
You will get error:
Type mismatch: inferred type is Array
To fix this, you need to use spread operator to unpack params array into the corresponding values:
If you are more interested what is under the hood try to compile/decompile to bytecode and check how is done. Spoiler alert : SpreadBuilder is used underthe hood ;)