Skip to content

Commit 89f1b00

Browse files
committed
Adds clarification to void type
Follow @zoffixznet comment in rakudo/rakudo#1982.
1 parent 8921b20 commit 89f1b00

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

doc/Language/nativecall.pod6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,14 +616,14 @@ leaks.
616616
617617
=comment TODO
618618
619-
TBD
619+
L<Blob>s and L<Buf>s are Perl 6 way of storing binary data. We can use them for interchange of data with native functions and data structures, although not directly. We will have to use L<C<nativecast>|/routine/nativecast>.
620620
621621
=head1 Function arguments
622622
623-
NativeCall also supports native functions that take functions as arguments. One example
624-
of this is using function pointers as callbacks in an event-driven system. When
625-
binding these functions via NativeCall, one need only provide the equivalent signature
626-
as a constraint on the code parameter:
623+
NativeCall also supports native functions that take functions as arguments. One
624+
example of this is using function pointers as callbacks in an event-driven
625+
system. When binding these functions via NativeCall, one need only provide the
626+
equivalent signature as a constraint on the code parameter:
627627
628628
use NativeCall;
629629
# void SetCallback(int (*callback)(const char *))

doc/Language/nativetypes.pod6

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ valid type, you can use it in expressions:
9999
my void $nothing;
100100
say $nothing.perl; # OUTPUT: «NativeCall::Types::void␤»
101101
102-
In practice, it is an C<Uninstantiable> type that can rarely be used by itself.
103-
However, it is generally found in typed pointers representing the equivalent to
104-
the C<void *> pointer in C.
102+
In practice, it is an C<Uninstantiable> type that can rarely be used by itself,
103+
and in fact it is L<explicitly forbidden in C<return> types|/language/nativecall#Passing_and_Returning_Values>. However, it is
104+
generally found in typed pointers representing the equivalent to the C<void *>
105+
pointer in C.
105106
106107
=begin code :preamble<use NativeCall;>
107108
sub malloc( int32 $size --> Pointer[void] ) is native { * };

0 commit comments

Comments
 (0)