I am new to swift and have an error in the following code. I have one function with two different parameters. Xcode(version 6) is giving an error on the second definition with a parameter as a function which takes one value.Here is the code:
func performOperation(operation: (Double, Double) -> Double) {
if(operandStack.count >= 2){
displayValue = operation(operandStack.removeLast(), operandStack.removeLast())
enter()
}
}
func performOperation(operation: Double -> Double){
if(operandStack.count >= 1){
displayValue = operation(operandStack.removeLast())
enter()
}
}