Not much to add except that the level of support for perl5 extensions seems pretty good.
In general, I haven't yet found a way to access overloaded operators directly.
Instead I'm calling the overloading subroutines by name - eg:
my $p5 = Inline::Perl5.new;
my $f1 = $p5.invoke('Math::Float128', 'new', '2.5');
my $f2 = $p5.invoke('Math::Float128', 'new', '3.0');
my $swap = 0; # Set to true if order of
# operands is to be swapped
# Set $f3 to $f1 divided by $f2
my $f3 = $f1._overload_div($f2, $swap);
say "# $f3";
# Outputs, as expected:
I was hoping to be able to do something like:
my $f3 = $f1 / $f2;
but that doesn't work, so I have to resort to calling Math::Float128::_overload_div() by name.
That's no big deal, but it still puzzles me that say "# $f3";
apparently manages to access the Math::Float128 overloading of "" without any need for me to call Math::Float128::_overload_string() by name.
Yet for all other overloaded operators I'm having to call the relevant subroutine.
The penny will drop when it's ready to fall ;-)
I'm also wondering whether Inline::Perl5 will work on MS Windows. Any experience of that here ?
I think it should be ok:
At some stage I'll grab a Windows version of perl6 ... and find out ...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] |