找不到动态变量@ * INC [英] Dynamic variable @*INC not found

查看:100
本文介绍了找不到动态变量@ * INC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在尝试使电子与Perl6一起工作,并且看起来在我竭尽全力破解事物以使其正常工作之后,它只是不想这样做。我使用了以下脚本(git上电子仓库中的示例之一):

So I've been trying to get electron working with Perl6 and looks like after all my efforts of hacking things to get them to work, it just doesn't want to do it's thing. I have used the following script (one of the examples from the electron repo on git):

#!/usr/bin/env perl6

use v6;

use Electron;

my $app = Electron::App.instance;
LEAVE {
  $app.destroy if $app.defined;
}

say Electron::Dialog.show-open-dialog.perl;

say Electron::Dialog.show-save-dialog.perl;

say Electron::Dialog.show-message-box.perl;

Electron::Dialog.show-error-box("Text", "Content");

prompt("Press any key to exit");

在运行时出现此错误:

Dynamic variable @*INC not found
  in submethod initialize at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 54
  in method instance at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 33
  in block <unit> at test.p6 line 9

Actually thrown at:
  in method throw at C:\rakudo/share/perl6/runtime/CORE.setting.moarvm line 1
  in block  at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 55
  in submethod initialize at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 48
  in method instance at C:\rakudo\share\perl6\site\sources\42D84B59BC3C5A414EA59CC2E3BC466BBAF78CDA line 33
  in block <unit> at test.p6 line 9

在查看了子方法后,我注意到这是电子的一部分perl6的模块,似乎不喜欢在模块中使用 @ * INC

And after looking at the submethod i noticed that this was part of the electron module for perl6 and it seems to not like the use of @*INC within the module.

有人成功地将电子模块与Perl6结合使用了吗?还有其他人遇到此错误吗?有什么简单的方法吗?

Has anyone managed to successfully use the electron module with Perl6? Has anyone else come across this error? Is there an easy way around it?

我可能可以修改模块以使其能够编译和运行,但是我不知道从何处开始替换 @ * INC

I can probably modify the module to get it to compile and run but I wouldn't know where to start with replacing the @*INC.

推荐答案

$ * REPO是6.c的替换Perl 5中的@INC


在Perl 5中, @INC 变量是Perl寻找时要搜索的全局路径数组模块(类似于许多OS使用的PATH变量来包含该OS正在寻找程序时要搜索的路径)。

$*REPO is the 6.c replacement for @INC in Perl 5

In Perl 5 the @INC variable is a global array of paths to be searched when Perl is looking for modules (analogous to the PATH variable used by many OSes to contain the paths to be searched when that OS is looking for programs).

直到最近Perl 6都有相应的 @ * INC 变量。

Until recently Perl 6 had a corresponding @*INC variable.

在6.c中,考虑到并发模块加载和高级模块选择功能引入的特性,因此对此数组不合适。 Perl 6模块存储库机制。

Having an array for this turned out to be inappropriate for 6.c given concurrent module loading and advanced module selection features introduced by the Perl 6 module repository mechanism.

大约在6.ca Lead dev(Stefan Seifert,又称九岁)之前一个月或两个月就通过新的<$ c $切换模块加载以使用链式回购方法c> $ * REPO 标量和过时

About a month or two before 6.c a lead dev (Stefan Seifert aka nine) switched module loading to use a chained repo approach via a new $*REPO scalar and obsoleted the include array.

出于各种原因,他们这样做并没有弃用期限。

For various reasons they did this without a deprecation period.

任何直接提到<$ c的6.c之前的模块$ c> @ * INC 需要更新,有些还没有更新。 Electron模块就是这样的一种-直到您提出问题为止(谢谢!),该模块的作者通过

Any pre 6.c modules that directly mention @*INC need an update and some haven't yet gotten that update. The Electron module was one such -- until you filed an issue (thanks!) and the module's author responded by fixing it.

我不知道有任何正式的 $ * REPO 的设计或最终用户文档。最好的信息可能是通过在freenode IRC频道#perl6-toolchain(nine 来找到的。 rel = nofollow noreferrer>日志加入)。

I'm not aware of any "official" design or enduser documentation of $*REPO. The best info is probably to be found by asking user nine on the freenode IRC channel #perl6-toolchain (logs; join).

这篇关于找不到动态变量@ * INC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆