lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


function f()
io.write("Hello")
end

and then

f()

it tells me that global f is nil ??
 
To me, it should have worked.

It doesn't, of course, if you declare f as local:

local function f()
  io.write("Hello")
end

It also won't work if you have closed and reopen the Lua state in between the 2 calls.