P14 - Duplicate the elements of a list.

Author: Scott Penrose

Specification

P14 (*) Duplicate the elements of a list.

Example

> say ~dupli();
a a b b c c c c d d

Source code: P14-scottp.pl

use v6;

sub dupli(@l) {
    return @l.map({$_, $_});
}
say ~dupli();