Skip to content

Commit 9fea5ea

Browse files
authored
Improve NC callback docs
- Fix incorrect constraint syntax - Link to fuller sig constraint docs
1 parent dcdaddc commit 9fea5ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/Language/nativecall.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,11 @@ say $esponja;
649649
NativeCall also supports native functions that take functions as arguments. One
650650
example of this is using function pointers as callbacks in an event-driven
651651
system. When binding these functions via NativeCall, one need only provide the
652-
equivalent signature as a constraint on the code parameter:
652+
equivalent signature as L<a constraint on the code parameter|/type/Signature.html#Constraining_signatures_of_Callables>:
653653
654654
use NativeCall;
655655
# void SetCallback(int (*callback)(const char *))
656-
my sub SetCallback(&callback (Str --> int32)) is native('mylib') { * }
656+
my sub SetCallback(&callback:(Str --> int32)) is native('mylib') { * }
657657
658658
Note: the native code is responsible for memory management of values passed to
659659
Perl 6 callbacks this way. In other words, NativeCall will not free() strings passed

0 commit comments

Comments
 (0)