3 ms·
sub infix:<d> ( $count, $faces ) { (1..$faces).roll($count) } # from this point on the language has changed to have a # new infix operator say 5
by b2gills 9y ago
sub infix:<d> ( $count, $faces ) {
(1..$faces).roll($count)
}
# from this point on the language has changed to have a
# new infix operator
say 5 d 20;
# (13 5 3 3 14)
The Rakudo implementation also has macros and Slangs which are more powerful, but we want it to have a better interface; so they are not part of the Perl 6 spec yet.