Ariel Scolnicov wrote:
> 
> It's currently not possible to use Inline::C to wrap a function
> without defining it.  For instance, if I want to use the (POSIX?) -lm
> library's erf() function, I'd have to say
> 
>         perl -le 'use Inline C => q<double i ( double x ) { return ierf ( x ) ; }>; 
>print i(0); print i(1);'
> 
> Here's a patch to the Inline-0.40 distribution to allow you to say
> just
> 
>         perl -le 'use Inline C => q<double erf ( double x ) ; >; 

Inline has always been centered around defining wrapper functions. Now
you can definitely do this:

---8<---
use Inline::Files;
use Inline C => BELOW => PREFIX => 'X_';
print erf(0), "\n"; 
print erf(1), "\n";
__C__
double X_erf(double x) { return erf(x); }
---8<---

So the Perl interface is preserved.

> 
> It addects only C/grammar/grammar.pm.  Is there any interest in this?
> Would there be more interest if you could drop the argument names
> (like you can in real C)?

I'll discuss the patch with Neil. He was the last one to touch the
grammar.

> 
> Brian -- is this the right place for such patches & discussion?

Oh definitely. And patches are always very much appreciated. (Doesn't
mean they'll always get in) A great way to say *exactly* what you mean!

Cheers, Brian

-- 
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'

Reply via email to