lua-users home
lua-l archive

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



Okay, so since I'm still at 5.1w3 I failed to notice this? For me, '...' was empty.

I'd propose simply giving the full path (where the filename now is) or rather, the '-l' argument used for acquiring it. This would be cool, since it normally doesn't have '.lua' appended, and therefore could be used as-such for finding any extension modules.

sample:
	lua -w -l Tools/Hamster/hamster build.lua

hamster.lua:

package.load( {...}[1].."_msc" ) -- would be same as '-l Tools/Hamster/hamster_msc'

I know there's no 'package.load()' but there should be?
-ak

6.1.2005 kello 20:00, Wim Couwenberg kirjoitti:

I like this approach. Wouldn't be hard for the authors, not consume much cpu cycles, and being very 'lua-ish' altogether. :) Also, it provides a nice way to do other similar per-library stuff later, if seen necessary.

The require system in 5.1 already passes the name to the package script (obtainable via the new ellipsis vararg support). The precise path to the package (if it is a file somewhere) could simply be an additional argument. That was what I proposed in LTN11 using a Package Install Function (due to lack of vararg support at script level in 5.0.2).

--
Wim