Skip to content
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

Closed
loops opened this issue Jun 29, 2018 · 7 comments
Closed

NativeCall, CArray[].allocate example not working #2132

loops opened this issue Jun 29, 2018 · 7 comments
Labels
docs Documentation issue (primary issue type) update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.

Comments

@loops
Copy link

loops commented Jun 29, 2018

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?

@JJ
Copy link
Contributor

JJ commented Jun 29, 2018

What version of Perl 6 are you using? I think it's the other way round, it's rather new.

@JJ
Copy link
Contributor

JJ commented Jun 29, 2018

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.

JJ added a commit to JJ/my-raku-examples that referenced this issue Jun 29, 2018
@loops
Copy link
Author

loops commented Jun 29, 2018

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.

@JJ
Copy link
Contributor

JJ commented Jun 29, 2018 via email

@JJ
Copy link
Contributor

JJ commented Jun 29, 2018

It starts to work in 2018.05, according to commitable. I'll clarify it in the docs. Thanks again for the report.

@loops
Copy link
Author

loops commented Jun 29, 2018

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.

@JJ JJ added docs Documentation issue (primary issue type) update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc. labels Jun 29, 2018
@JJ
Copy link
Contributor

JJ commented Jun 29, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type) update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.
Projects
None yet
Development

No branches or pull requests

2 participants