Marcel Grunauer wrote:
> 
> Hi,
> 
> just playing around with Damian's Attribute::Handlers; here's
> *the beginning of* an idea to inline subs directly, using attributes:

Hey Marcel,

Neil and I came up with this patch that makes your code sooooo much
better. You can use it later today when Inline::Files hits the CPAN.

---8<---
--- bad Fri May 25 11:10:33 2001
+++ good        Fri May 25 11:18:02 2001
@@ -3,16 +3,17 @@
 use warnings;
 use strict;
 use lib './lib';
-use Attribute::Inline;
-
-sub add :C('int', 'int x, int y') {
-         qq{ return x + y; }
-}
-
-sub subtract :C('int', 'int x, int y') {
-         qq{ return x - y; }
-}
+use Inline::Files;
+use Inline 'C';
 
 print "9 + 16 = ", add(9, 16), "\n";
 print "9 - 16 = ", subtract(9, 16), "\n";
 
+__C__
+int add(int x, int y) {
+    return x + y;
+}
+
+int subtract(int x, int y) {
+    return x - y;
+}
---8<---

Umm, don't hit me. 

*ingy ducks*
*neil runs*


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

Reply via email to