in reply to Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends

Can you give an example of how to call Java code from Perl6 ?

  • Comment on Re: Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends

Replies are listed 'Best First'.
Re^2: Rakudo Star (Perl 6 bundle) now supports MoarVM and JVM backends
by raiph (Deacon) on May 07, 2014 at 16:45 UTC
    From jnthn's examples of calling Java code:

    use java::util::zip::CRC32:from<java>; my $crc = CRC32.new(); for 'Hello, Java'.encode('utf-8') { $crc.'method/update/(B)V'($_); } say $crc.getValue();

    As you can see, it requires an arcane string in place of a regular method name. Aiui jnthn knows what they have to do to fix this (so you can just use a regular method name) but I don't think any core hacker currently has it high on their todo list.