createOperator

fun createOperator(key: String, precedence: Int, leftAssociative: Boolean = true, operation: (Double, Double) -> Double): KthOperator

Helper function to create a KthOperator.

Return

the created KthOperator

Parameters

key

the operator key

precedence

the operator precedence

leftAssociative

whether the operator is left associative

operation

the operator operation