Global functions and capturing values in swift
<p>Swift documentation says that closures and nested functions can capture values while global functions can not. Why then this is not a compilation error (in fact it looks like the global funciton myFunc() captures the value.)</p>

<pre><code>var myInt = 0

func myFunc()
{
    myInt+=1
}

print(myInt) //prints 0
myFunc()
print(myInt) //prints 1
</code></pre>

<p>I am running this in Xcode playground, could that have something to do with it?</p>

<p>Thanks </p>