I thought that all the Perl 6 plugins were really functions that we could override.
whileIt is not a subroutine or macro, but part of the syntax defined in the Perl6 grammar .
, , .
- , , ( %*LANG, , ).
froop.pm6:
use nqp;
sub EXPORT {
nqp::bindkey(%*LANG, 'MAIN', nqp::atkey(%*LANG, 'MAIN').^mixin(role {
rule statement_control:sym<while> {
[$<sym>=froop{
$/.hash<sym>.^mixin: role {
method Str { 'while' }
}
}|$<sym>=until]<.kok> {}
<xblock>
}
}));
once Map.new
}
while ( ) froop,
use froop;
my $i = 0;
froop $i < 5 { say $i++ }