Skip Menu |
Report information
Id: 131401
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: ben-goldberg [at] hotmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



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
Download (untitled) / with headers
text/plain 579b
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.
 
 


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org