lua-users home
lua-l archive

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


On 04/27/2014 01:32 PM, luciano de souza wrote:
Hello all,

I am not able to run my first Orbit example.

I did:

sudo luarocks install orbit
sudo luarocks install wsapi
sudo luarocks install wsapi-xavante
sudo luarocks install xavante

Everything seems to be OK. So I did:

local orbit = require('orbit')

And my local orbit table is nil!

When I did "require('orbit'), Lua does not show errors. But when I did
"module('example', package.seeall, orbit.new)", the error is shown
becose "orbit" is nil.

What dos it means?

I am using Lua 5.1 with Ubuntu 13.04 64 bits.


are you doing this in the interactive Lua interpreter?
in the interactive interpreter, each statement or block is loaded as seperate
chunk, so they have different lexical scope. so the `local' keyword won't
do what you expected. and the `module' function won't work properly either.