[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modules with standalone main program
- From: albertmcchan <albertmcchan@...>
- Date: Mon, 26 Feb 2018 15:46:43 -0500
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 ?