New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NativeCall, CArray[].allocate example not working #2132
Comments
|
What version of Perl 6 are you using? I think it's the other way round, it's rather new. |
|
Right, new as in 2 months ago. Upgrading to 2018.04 will probably fix that. Tell me if that's the case to close the issue, although if you thin, some note should be added indicating that, we can do that, too. |
|
I was at an older version, but just upgraded to: This is Rakudo Star version 2018.04.1 built on MoarVM version 2018.04.1 And error persists. |
|
It might be the next one, then. I'll check and clarify. Thanks for the
report.
|
|
It starts to work in 2018.05, according to commitable. I'll clarify it in the docs. Thanks again for the report. |
|
Odd, i've tried it on two separate machines now with 2018.04.1 and get the error. They're self compiled on Fedora Linux. Maybe my environment has introduced some problem? I'm testing from the repl with just: use NativeCall; CArray[int32].allocate(5) And getting the error. |
|
El vie., 29 jun. 2018 a las 17:59, Sean (<notifications@github.com>)
escribió:
Odd, i've tried it on two separate machines now with 2018.04.1 and get the
error. They're self compiled on Fedora Linux. Maybe my environment has
introduced some problem? I'm testing from the repl with just:
use NativeCall; CArray[int32].allocate(5)
Something was wrong with _my_ environment. Got it now. Thanks!
|
The problem
From https://docs.perl6.org/language/nativecall#index-entry-CArray_methods
use NativeCall;
my $number_of_ints = 10;
my $ints = CArray[int32].allocate($number_of_ints);
Gives:
No such method 'allocate' for invocant of type 'NativeCall::Types::CArray[int32]'
There are other places on that page where .allocate is also referenced.
Suggestions
Not sure, maybe allocate has been replaced somehow?
The text was updated successfully, but these errors were encountered: