perl6/rakudo:无法解析 postcircumfix:sym<( )>
为什么我会收到此错误消息?
#!perl6
use v6;
my @a = 1..3;
my @b = 7..10;
my @c = 'a'..'d';
for zip(@a;@b;@c) -> $nth_a, $nth_b, $nth_c { ... };
# Output:
# ===SORRY!===
# Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Rakudo 尚未实现 lol(“列表的列表”)形式,因此无法解析
@a;@b;@c
。出于同样的原因,zip
还没有包含三个列表的表单。显然,错误消息不太好。目前还没有真正好的解决方法,但这里有一些可以完成工作的方法:
Rakudo doesn't implement the lol ("list of lists") form yet, and so cannot parse
@a;@b;@c
. For the same reason,zip
doesn't have a form which takes three lists yet. Clearly the error message is less than awesome.There isn't really a good workaround yet, but here's something that will get the job done:
多维语法(在括号内使用
;
)和跨越两个以上列表的 zip 都可以工作,因此最初发布的代码现在可以工作(如果您提供一些真实的代码而不是{ ... }
存根块)。The multi-dimensional syntax (the use of
;
inside parens) and zip across more than two lists both work, so the code originally posted now works (if you provide some real code rather than the{ ... }
stub block).