|From:||Benjamin Goldberg <ben-goldberg [...] hotmail.com>|
|To:||rakudobug <rakudobug [...] perl.org>|
|Subject:||Feature Request NativeCall function pointer typedef|
|Date:||Mon, 29 May 2017 20:32:14 +0000|
In C, it’s possible to use typedefs for all sorts of things, including:
typedef int (*callback_t)( struct node_t * n, void *user_data );
void walk_tree( struct tree_t *t, callback_t c, void * user_data );
It would be nice if there existed some way define, in perl6, an equivalent of callback_t which
would work with NativeCall. At present, the subsignatures of a callback must be fully written out,
and that can get very tedious if there are several functions which take the same type of callback.
I’m not sure of the best way to do this, honestly.