Skip to content

Commit

Permalink
Adds pointer to index, closes Raku#4028
Browse files Browse the repository at this point in the history
Also adds a bit of introduction
  • Loading branch information
JJ committed Feb 9, 2022
1 parent 3b68625 commit f5f26bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/Language/nativetypes.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ your programs since it is not part of the Raku specification.
X<|void type (NativeCall)>
=head1 The C<void> type
The native C<void> type corresponds to the C C<void> type. Although, being a
The native C<void> type corresponds to the C namesake type; being a
valid type, you can use it in expressions:
use NativeCall;
Expand All @@ -175,6 +175,12 @@ my Pointer[void] $for-malloc = malloc( 32 );
say $for-malloc.raku;
=end code
X<|Pointer>
As the example shows, it's represented by a parametrized C<Pointer> role,
using as parameter whatever the original pointer is pointing to (in this
case, C<void>). This role represents native pointers, and can be used
wherever they need to be represented in a Raku program.
You can also L<nativecast|/routine/nativecast> L<Blob|/type/Blob>s to this kind
of pointer in case you need to work with them in native functions that use the
type
Expand Down

0 comments on commit f5f26bd

Please sign in to comment.