Hi Garrett,

> package MyClass;
> use Inline::Attributes;
>
> sub C :INLINE (
>   void hello()
>   {
>     printf("Hello\n");
>   }
> );
>
> &hello;
>
> 1;
> __END__

took me a while to understand what you're doing here, but that's
clever - the whole function as the attribute data.

Still, I don't see the advantage of that over __C__ sections or
just saying  'use Inline C => ...' as you still have to define
the whole C function within another construct; the idea was to
have the C function look like a perl sub:

> sub add :C('int', 'int x, int y') {
>          qq{ return x + y; }
> }

Except it ended up with fluff - return type and arg declaration
in the attribute data; and the body embedded in quotes. I suppose
a source filter could help here...

Marcel

--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
  -- London.pm strategy aka "embrace and extend" aka "mark and sweep"

Reply via email to