[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: setting _ENV in Lua 5.2 when loading a file...?
- From: Miles Bader <miles@...>
- Date: Thu, 10 Nov 2011 20:09:56 +0900
Michal Kottman <k0mpjut0r@gmail.com> writes:
> I could not find the message on this list, but I remember an
> 'io.lines' trick to do the job with load:
>
> 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!)
Thanks,
-Miles
--
"1971 pickup truck; will trade for guns"