lua-users home
lua-l archive

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


On Feb 26, 2018, at 3:06 PM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

>> 
>> if __name__ == '__main__':
>>   print "running code standalone"
>> 
>> my lua equivalent:
>> 
>> if not package.loading "mod" then
>>   print "running code standalone"
>> end
> 
> This looks like a fail to me:
> 
>  package.loading = function () return true end; dofile("mod.lua")

you are not playing fair :-(

Deleting my package.loading function and replacing
with another that always eval to true ?