title: Call by reference, value, and name
body: <p>I'm trying to understand the conceptual difference between call by reference, value, and name.</p>
  
  <p>So I have the following pseudocode:</p>
  
  <pre><code>foo(a, b, c)
  {
     b =b++;
     a = a++;
     c = a + b*10
  }
  
  X=1;
  Y=2;
  Z=3;
  foo(X, Y+2, Z);
  </code></pre>
  
  <p>What's X, Y, and Z after the foo call if a, b, and c are all call by reference?
  if a, b, and c are call-by-value/result?
  if a, b, and c are call-by-name? </p>
  
  <p>Another scenario: </p>
  
  <pre><code>X=1;
  Y=2;
  Z=3;
  foo(X, Y+2, X);
  </code></pre>
  
  <p>I'm trying to get a head start on studying for an upcoming final and this seemed like a good review problem to go over. Pass-by-name is definitely the most foreign to me. </p>