An one-hour hack of mine proved fruitful.  This is Perl 5 script,
calling into Perl 6 functions defined inline:

    #!/usr/bin/perl
    use Inline Pugs => '
        sub postfix:<!> { [*] 1..$_ }
        sub sum_factorial { [+] 0..$_! }
    ';
    print sum_factorial(3); # 21

The implementation is in lib/Inline/Pugs.pm that comes with Pugs tree.
You'll need Inline.pm from CPAN to run the example above.

Patches, suggestions, etc welcome. :-)

Enjoy,
/Autrijus/

Attachment: pgpOJkC4Kj7tY.pgp
Description: PGP signature

Reply via email to