0

I follow the Standford course and now Im stuck because same instance methods name with different parameters now give errors

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()
    }
}

The fix I have is rename one function to another name. What should I do ? I am new to Swift so please keep it simple.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Michael Nguyen
  • 1,691
  • 2
  • 18
  • 33

1 Answers1

0

Yes, you should rename one of those functions. Name the first one performTwoParameterOperation, for example.

Duncan C
  • 128,072
  • 22
  • 173
  • 272