_REQUIREDNAME always nil

Posted by Nali4Freedom on Stack Overflow See other posts from Stack Overflow or by Nali4Freedom
Published on 2010-05-19T22:13:50Z Indexed on 2010/05/19 22:40 UTC
Read the original article Hit count: 138

Filed under:
|

I'm trying to use the method for naming a lua package after the filename mentioned here, however _REQUIREDNAME is never defined. For example I have these two files

samplePackage.lua:

print("_REQUIREDNAME: ", _REQUIREDNAME)
return nil;

packageTest.lua:

require "samplePackage"

And when I run packageTest.lua it outputs > _REQUIREDNAME: nil

I also couldn't find any mention of _REQUIREDNAME in the Lua 5.1 Refrence manual, so was this removed from the language, or am I missing something?

© Stack Overflow or respective owner

Related posts about lua

Related posts about packages