invert
列表的方法应该返回反转的序列,或者至少是源似乎暗示的那个.然而:
say (1,3,2).invert
Run Code Online (Sandbox Code Playgroud)
失败了:
(exit code 1) Type check failed in invert; expected Pair but got Int (1)? in block <unit>
Run Code Online (Sandbox Code Playgroud)
文档没有帮助,因为它是该区域的LTA(并且缺少List).但源代码不承认任何含糊不清的解释.这里有什么我想念的吗?
也许你打算使用反向方法.好吧,如果你想要结果(2,3,1)
.
看起来List.invert
确实缺少文档.它仅适用于List
由Pair
s 组成的.我现在就写下来.
编辑:doc添加了https://github.com/perl6/doc/commit/0ee3245776