Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
Inline::Perl5 is probably not the recommended entry point to perl6. But it's, so far, the only aspect of perl6 I've come across that has piqued my interest in perl6 - and it looks like it's going to become *my* entry point (for that given reason). Nevertheless, I'm happy to apologise for this unorthodoxy on my part if that's deemed appropriate. (Blame Doug Hunt on the PDL mailing list for having mentioned Inline::Perl5 on the PDL-dev mailing list ;-) So ... I have a perl5 module named Math::Float128. Basically, it does __float128 arithmetic, and it builds fine on most platforms if you use a recent port of the gcc compiler. As an exercise, I thought it would be interesting (for me) to access that module and its functionality from perl6. On Ubuntu 14.04 I have: And, after muddling my way through the installation of Inline::Perl5 (with the assistance of a number of patient monks), I've come up with this perl6 script (which works fine): That correctly outputs: Based on that it seems to me that the perl5 overloading of "" is being correctly accessed - as that's the only way I can think of that both say "$f128"; and $f128.print; would render correctly. Is that assessment correct ? (That's my first question). Inspired by the success of $f128.print; I tried $f128.say; But that just outputs: Why ? (That's my second question). Is there a better way to access __float128 arithmetic using perl6 ? (My third and last question ... for tonight ;-) Cheers, Rob In reply to [perl6] More Inline::Perl5 musings by syphilis
|
|