Skip to content

Commit 13b8c95

Browse files
committed
Adds rakudo-specific native types. Closes #2142
1 parent 34d8575 commit 13b8c95

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/Language/nativetypes.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ ssize_t (size_t in C)
156156
bool (bool in C)
157157
=end table
158158
159+
You can use them in the same way they would be used in native C:
160+
161+
=begin code
162+
use NativeCall;
163+
164+
my $just-an-array = CArray[int32].new( 1, 2, 3, 4, 5 );
165+
166+
loop ( my size_t $i = 0; $i < $just-an-array.elems; $i++ ) {
167+
say $just-an-array[$i];
168+
}
169+
=end code
170+
171+
Which would print the five elements of the array, as it should be expected.
172+
159173
=end pod
160174

161175
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)