[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: setting _ENV in Lua 5.2 when loading a file...?
- From: Miles Bader <miles@...>
- Date: Thu, 10 Nov 2011 23:40:20 +0900
Roberto Ierusalimschy <email@example.com> writes:
>> > function myloadfile(filename, env)
>> > return load(io.lines(filename, '*L'), filename, 't', env)
>> > end
>> Hmm, I expect that's not very efficient for extremely large files
>> though... (even read"*a" is horrible for extremely large files!)
> return load(io.lines(filename, 2^12), filename, 't', env)
> seems reasonable.
So is there a reason you guys just don't have an extra two arguments for
loadfilename, which are passed straight through to the underlying call
to load? It would be trivial to implement, and handy -- and make the
interface much less clumsy.
Do not taunt Happy Fun Ball.