Re: nativecall and variable argument lists

2019-08-29 Thread Marcel Timmerman
perl6 users *Subject: *Re: nativecall and variable argument lists Hello, Thanks to the amazing job Lizmat did to implement runtime signatures it can be done. You could also probably add some caching of the signatures and the functions. I didn’t benchmark. Here the code: use NativeCall; sub pe

Re: nativecall and variable argument lists

2019-08-29 Thread Vittore Scolari
perl6 users Subject: Re: nativecall and variable argument lists Hello, Thanks to the amazing job Lizmat did to implement runtime signatures it can be done. You could also probably add some caching of the signatures and the functions. I didn’t benchmark. Here the code: use NativeCall;

Re: nativecall and variable argument lists

2019-08-29 Thread Vittore Scolari
Hello, Thanks to the amazing job Lizmat did to implement runtime signatures it can be done. You could also probably add some caching of the signatures and the functions. I didn’t benchmark. Here the code: use NativeCall; sub pera-int-f(Str $format, *@args) {     state $ptr =

nativecall and variable argument lists

2019-08-29 Thread Marcel Timmerman
Hi, Is there a way to declare a native sub in such a way that it can handle variable argument lists? For example sprintf()? While I'm at it, another question; I need to define native subs which can receive a function as an argument to be used as a callback. Why do I have to specify the