[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Local and Global Variables
- From: Thomas Jericke <tjericke@...>
- Date: Sat, 27 Apr 2013 08:58:12 +0200
On 04/26/2013 05:48 PM, Doug Currie wrote:
If this is what you want, then the local and global keywords mean the same thing. In expression oriented languages of the ML family, this keyword is called val. It declares a new value in the present scope. So your example becomes:
if someboolean then
myvar = 0
val g2 = 7
if true then
global g = "hello"
local l = " world"
print(a) -- prints "hello"
print(b) -- prints "nil"
globals still would have the same semantics as now, you would only
declare them before using of them.