title: How do I use functions as variables?
body: <p>So I'm used to working with <a href="/questions/tagged/javascript" class="post-tag" title="show questions tagged &#39;javascript&#39;" rel="tag">javascript</a>, and being able to simply do</p>
  
  <pre><code>dog={};
  dog.name="Rex";
  dog.examine=function(){console.log("This is a dog. Its name is "+this.name+".");}
  cat={};
  cat.name="Phil Collins";
  cat.examine=function(){console.log("This is a cat. Its name is "+this.name+".");}
  
  dog.examine();
  cat.examine();
  </code></pre>
  
  <p>This would return, of course : <em><code>This is a dog. Its name is Rex.</code></em> and <em><code>This is a cat. Its name is Phil Collins.</code></em></p>
  
  <p>I've started learning <a href="/questions/tagged/xna" class="post-tag" title="show questions tagged &#39;xna&#39;" rel="tag">xna</a>, and I'm very confused by this whole <code>lambda</code>/<code>delegate</code>/<code>action</code> system. I'm not sure what syntax to use, the compiler gets angry when I try to make a function with no input or output variables, and I'm having trouble keeping the proper scope for <em><code>this</code></em>. Could someone please help me find out how I'd port the above code into <a href="/questions/tagged/c%23" class="post-tag" title="show questions tagged &#39;c#&#39;" rel="tag">c#</a>?</p>