lua-users home
lua-l archive

Re: How to specify parameters to a file chunk?

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


Many thank you all. It seems that my PIL is quite out of date
2007年1月5日, Glenn Maynard <glenn@zewt.org>:
On Fri, Jan 05, 2007 at 01:47:55PM +0800, chong tsong wrote:
> As we know, loadfile() read a lua file and build a function accordingly.
>
> Can we give the function any parameters when invoking it?
>
> for example:
>
> -- chunk.lua
> print(arg[1])
> io.flush()
"arg" is a 5.0ism. In 5.1, use "...":
 local a = ...;
 print(a);
or any of the other ways of accessing "...", eg. print(...).
--
Glenn Maynard

AltStyle によって変換されたページ (->オリジナル) /