lua-users home
lua-l archive

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


> package.searchpath('myprog.lua','.') can't find './myprog.lua'.
> package.searchpath('myprog','./?.lua') is needed instead.

Note that your first example should be
  package.searchpath('myprog.lua', '?')


> This is an unfortunate (and maybe unintended?) consequence of the 
> way dots in filenames are treated by package.searchpath.
> 
> If it is too late to use a less common character like '%' in the 
> beta version of Lua 5.2, a line in the Reference Manual detailing 
> this case would be helpful.

The treatment of dots comes from submodules, which are written like
'mod.submod'; so, it is not easy to change to another character.  Maybe
this handling in searchpath could be optional.

-- Roberto