lua-users home
lua-l archive

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


I've got it working now 

the bug was in my index so I only ever called the script containing f()

/Jacob

On Sep 21, 2012, at 8:43 PM, Rapin Patrick <rapin.patrick@gmail.com> wrote:

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.