title: trying to avoid mutables in scala.. is this the right way?
body: <p>I'm trying to avoid mutable variables as much as possible, but sometimes it just feels too hard, and I don't want to end with an extremely complicated code</p>
  
  <p>Nevertheless I found this way to do it, but it certainly feels like cheating</p>
  
  <p>I'm parsing a query, and I find find a field!value, I want to translate it to field:&lt;>value, and then go on processing, so I came out with this code to avoid mutables, or at least to have them confined...</p>
  
  <pre><code>val (operator, negated) = {
    var operator = ConditionOperator.toConditionOperator(parsedOperator)
    var negated = parsedNegated == "!"
    // field!value =&gt; field notEqual value
    if (negated &amp;&amp; operator == ConditionOperator.Unknown) {
      negated = false
      operator = ConditionOperator.NotEqual
    }
    (operator, negated)
  }
  </code></pre>
  
  <p>Is this the right way to do it??? or is there a more idiomatic (and clear!) way to achieve this kind of things?</p>