Pretty::Topic - Alias $_
topical variable to something prettier
use Pretty::Topic '♥';
say ^4 .map: { $_ + 10 }; # fugly
say ^4 .map: { ♥ + 10 }; # purty!
given <meow woof>.pick {
when ♥ ~~ /meo/ { say 'Tis a kitty!' }
when ♥ ~~ /oof/ { say 'Tis a doggy!' }
}
Multi-char alias is fine too:
use Pretty::Topic 'TOPIC-VAR';
say ^4 .map: { TOPIC-VAR + 10 };
This module aliases the $_
topical variable to a string you provide on the
use
line, allowing you to avoid the eyesore the $_
is.
This module exports the string you provide on the use
line as a &term:<>
.
The current implementation doesn't let you use <
or >
in topic's name.
Open an Issue if you really really need that feature.
Fork this module on GitHub: https://github.com/zoffixznet/perl6-Pretty-Topic
To report bugs or request features, please use https://github.com/zoffixznet/perl6-Pretty-Topic/issues
Zoffix Znet (http://zoffix.com/)
You can use and distribute this module under the terms of the
The Artistic License 2.0. See the LICENSE
file included in this
distribution for complete details.