Is there is something like code synonyms in C#?
<p>For example i have some code:</p>

<pre><code>if (myArray[i, j, k] == someValue)
  myArray[i, j, k] = someOtherValue;
else
  throw new Exception(string.Format("value {0} is wrong!", myArray[i, j, k]));
</code></pre>

<p>and it seems that it is a bit dangerous. I would like to had some "code synonym", like that:</p>

<pre><code>var xx =&gt; myArray[i, j, k];
if (xx == someValue)
  xx = someOtherValue;
else
  throw new Exception(string.Format("value {0} is wrong!", xx));
</code></pre>

<p>where <code>xx</code> isn't a value of <code>myArray[i, j, k]</code>, but a synonym to that code, and <code>=&gt;</code> is some kind of declaration syntax for this construct.</p>

<p>I'd like to have this feature to ensure that multiply <code>myArray[i, j, k]</code> usage would be exactly the same code, without risk of getting <code>myArray[j, i, k]</code> in some place.</p>

<p>May be C# can do something like that, without ugly syntax? I mean safe code, not unsafe memory pointer. Or maybe something is wrong with my point of viewh?</p>

<hr>

<p>I apologize for possibly incorrect definition of my idea. I'd like to use this trick ("code synonyms" or something like that) as regular feature of language(? or compiler etc), not only in this single case. Specialized classes or functions are good in particular case, but in general they will lead to a significant increase in the amount of code, and i would like to avoid this.</p>
