title: Accessing global variable in Swift
body: <p>Given this sample Swift code:</p>
  
  <pre><code>var a = 10;
  
  func foo() -&gt; Int {
      var a = 20;
      return a;
  }
  </code></pre>
  
  <p>How can function foo get access to global variable a with value 10 instead of the local a with value 20?</p>
  
  <p>Please note that both a and foo are not declared inside a class but in a generic module. I am looking for a way to tell Swift to access globally defined a var instead of the locally defined one.</p>