title: Immutable array on a var?
body: <p>I am getting the error: </p>
  
  <p>Immutable value of type 'Array Character>' only has mutating members of name removeAtIndex()</p>
  
  <p>The array should have contents because that removeAtIndex line is in a loop who's condition is if the count > 1    </p>
  
  <pre><code>func evaluatePostFix(expression:Array&lt;Character&gt;) -&gt; Character
  {
      var stack:Array&lt;Character&gt; = []
      var count = -1 // Start at -1 to make up for 0 indexing
  
      if expression.count == 0 {
          return "X"
      }
  
      while expression.count &gt; 1 {
          if expression.count == 1 {
              let answer = expression[0]
              return answer
          }
  
          var expressionTokenAsString:String = String(expression[0])
          if let number = expressionTokenAsString.toInt() {
              stack.append(expression[0])
              expression.removeAtIndex(0)
              count++
          } else { // Capture token, remove lefthand and righthand, solve, push result
              var token = expression(count + 1)
              var rightHand = stack(count)
              var leftHand = stack(count - 1)
              stack.removeAtIndex(count)
              stack.removeAtIndex(count - 1)
              stack.append(evaluateSubExpression(leftHand, rightHand, token))
          }
      }
  }
  </code></pre>
  
  <p>Anyone have any idea as to why this is? Thanks!</p>