GNU bug report logs -
#25425
lua does not set search paths
Previous Next
Full log
Message #17 received at 25425 <at> debbugs.gnu.org (full text, mbox):
Hello!
Ricardo Wurmus <rekado <at> elephly.net> skribis:
> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> I think this should work:
>>
>> (search-path-specification
>> (variable "LUA_PATH")
>> (separator ";")
>> (files '("share/lua/5.3"))
>> (file-pattern "\\.lua$")
>> (file-type 'regular))
>
> I tried this very same thing but it doesn’t work because Lua expects
> placeholders (“?”) in the search paths. The placeholders are replaced
> with the actual package names. If the actual file name does not exist
> it will try the next pattern. If the file *does* exist – which *will* be
> the case for any of the files on LUA_PATH that have been generated by
> the search-path-specification — Lua will try to load the package from
> that path.
>
> This will fail because a search for the “lpeg” module would be satisfied
> by the file “re.lua”, because that’s the first valid file on the
> LUA_PATH. “re.lua” requires “lpeg” itself, so another lookup is
> performed, which will again result in “re.lua” to be loaded…
>
> AIUI we must generate a value for LUA_PATH that keeps the placeholders
> intact.
So are you saying that it’s important for the question marks to remain
intact?
This sounds terrible. I’m not sure how to address it, and I don’t feel
like stretching the search path mechanism this much.
Thoughts?
Ludo’.
This bug report was last modified 4 years and 78 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.