Not sure whether this should be p6-lan or p6-users. Posted to p6l only.

Given a function implemented in parrot, how can it be called from a perl6 program?

Suppose I have a file (in current path)

myfun.pir

which contains

.sub myfun
   .param pmc passed_variable
   .local int an_int
   an_int = passed_variable[1]
   .local string string_var
#code
   .return (string_var)
  end                            # is this necessary?
.end

how do I create a mymodule.pm so that I can in a perl6 program do

use mymodule;

my $parameter = 30;
my $string_var = myfun($parameter);

???

If this is documented, please just send a pointer.

Richard

Reply via email to