P20 - 删除列表中的第 k 个元素。
作者:Ryan Connelly
示例
> say remove-at(<a b c d e>, 4); a b c e
源代码: P20-topo.pl
use v6; sub remove-at(@list is copy, $place) { @list.splice($place - 1, 1); @list } say "{remove-at(<a b c d e>, 4)}";
作者:Ryan Connelly
> say remove-at(<a b c d e>, 4); a b c e
源代码: P20-topo.pl
use v6; sub remove-at(@list is copy, $place) { @list.splice($place - 1, 1); @list } say "{remove-at(<a b c d e>, 4)}";