[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Can a Lua module find out whether it is being required or dofiled?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 23 Sep 2015 11:04:48 -0300
> - require will pass the module name to the file chunk as argument
Since Lua 5.2, require also passes the path to the file:
% cat m.lua
print("args",...)
% lua -lm /dev/null
args m ./m.lua
% lua m.lua
args