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
  • 307,833
  • 40
  • 508
  • 550
Michael Nguyen
  • 1,575
  • 2
  • 17
  • 32

1 Answers1

0

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

Duncan C
  • 122,346
  • 22
  • 162
  • 258