No description, website, or topics provided.
Perl 6
Switch branches/tags
Nothing to show
Latest commit 9bbfc7a Aug 18, 2017 @FROGGS committed on GitHub Merge pull request #5 from timo/patch-1
chase rakudo changes, up version.
Permalink
Failed to load latest commit information.
lib/overload chase rakudo changes, up version. Aug 18, 2017
t initial commit Nov 16, 2014
.travis.yml Use zef instead of panda Aug 18, 2017
META6.json chase rakudo changes, up version. Aug 18, 2017
README.md adjust title font size Nov 16, 2014

README.md

overload::constant

It is meant to work a bit like P5's overload::constant[1], though it is kind of pre-alpha here.

USAGE

    sub integer { "i$^a" }
    sub decimal { "d$^a" }
    sub radix   { "r$^a" }
    sub numish  { "n$^a" }
    use overload::constant &integer, &decimal, &radix, &numish;

    ok 42      ~~ Str && 42      eq 'i42',      'can overload integer';
    ok 0.12    ~~ Str && 0.12    eq 'd0.12',    'can overload decimal';
    ok .1e-003 ~~ Str && .1e-003 eq 'd.1e-003', 'can overload decimal in scientific notation';
    ok :16<FF> ~~ Str && :16<FF> eq 'r:16<FF>', 'can overload radix';
    ok NaN     ~~ Str && NaN     eq 'nNaN',     'can overload other numish things';

[1] http://perldoc.perl.org/overload.html#Overloading-Constants