Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7d9c16311e
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (10 sloc) 0.279 kB
use v6;
# Specification:
# P16 (**) Drop every N'th element from a list.
# Example:
# > say ~drop(<a b c d e f g h i k>, 3);
# a b d e g h k
sub drop(@ary, $n) {
gather for 1 .. @ary.elems -> $i { take @ary[$i - 1] if $i % $n }
}
drop(<A B C D E F G H I K>, 3).perl.say;
Jump to Line
Something went wrong with that request. Please try again.