
package.config(由我添加的编号): The first line is the directory separator string. Default is ‘\‘ for windows and ‘/‘ for all other systems. The second line is the character that separates templates in a path. Default is ‘;‘. The third line is the string that marks the substitution points in a template. Default is ‘?‘. The fourth line is a string that,in a path in windows,is replaced by the executable’s directory. Default is ‘!‘. The fifth line is a mark to ignore all text before it when building theluaopen_function name. Default is ‘-‘.
我的解释:
>绝对清晰(windows /其他系统的示例使其成为傻瓜证明)
>路径字符串中可以有多个路径.它们由此符号分隔(默认情况下为;).
>无论Lua在路径字符串中找到此字符(默认情况下为?),它都会将其替换为提供给require或package.searchpath函数的模块名称,并检查该文件是否存在.
到目前为止,这么好,但最后两行对我来说并不完全清楚.
>为什么它说“在windows中的路径”?这是否意味着在其他平台上,这没有任何意义?如果是这样,为什么?
>我花了一段时间来理解这一点,但最终another part of the specs给了我一个提示:
The name of this C function is the string “
luaopen_” concatenated with a copy of the module name where each dot is replaced by an underscore. Moreover,if the module name has a hyphen,its prefix up to (and including) the first hyphen is removed. For instance,if the module name isa.v1-b.c,the function name will beluaopen_b_c.
这个符号( – 默认情况下)也是如此,它可以同时提供不同版本的库 – 可能是对最新版本的无前缀符号链接,以便可以在两个路径上访问相同的库(即在两个模块名称下),但只有一个C符号名称?
解决方法 4:linux应用程序在系统范围内安装了库;但是,对于windows,库可以安装在当前目录中.5:我认为版本控制和项目分叉将是背后的原因.
总结以上是内存溢出为你收集整理的Lua的`package.config`中的最后几行是什么意思?全部内容,希望文章能够帮你解决Lua的`package.config`中的最后几行是什么意思?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)