Ryan and all,

Congratulations! As the author of Inline::C for Perl, I highly applaud this
effort. In fact, I *knew* it would happen. Just needed someone like you to
get it going. I'd be happy to share any advice you might need. Keep on!

Notes:
  - Ken Simpson wrote PyInline
  - Neil Watkiss wrote Inline::Ruby and Inline::Python for Perl

BTW, I attended my first Ruby meeting in Portland last night. I showed
them Inline::Ruby. This is my favorite example. Pass Perl subroutines to
Ruby iterator functions.

   use Inline Ruby;

   $obj = Iterator->new(1, "2", [3, 4], {5 => 6});
   $obj->iter(\&my_iter)->each;

   sub iter {
       use Data::Dumper;
       print Dumper \@_;
   }

   __END__
   __Ruby__

   class Iterator
     def initialize(*elements)
       @elements = elements
     end
     def each
       for i in @elements
         yield i
       end
     end
   end

Cheers, Brian


On 10/09/02 16:06 -0400, Pat Eyler wrote:
> I don't know if you're tracking the ruby lists, so thought i'd forward
> this down for your reading pleasure.
> 
> -pate
> ---------- Forwarded message ----------
> Date: Tue, 10 Sep 2002 11:15:00 -0700
> From: Ryan Davis <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: Seattle Ruby Brigade! <[EMAIL PROTECTED]>,
>      [EMAIL PROTECTED]
> Subject: RubyInline 1.0.4 Released!
> 
> RubyInline 1.0.4 has been released!
> 
> Ruby Inline is my quick attempt to create an analog to Perl's
> Inline::C. The ruby version isn't near as feature-full as the perl
> version, but it is neat!
> 
> Here is the output from the example bundled with the package (factorial
> 5):
> 
> <507> ./example.rb slow
> RubyInline 1.0.4
> Type = Native, Iter = 1000000, time = 24.01048500 sec, 0.00002401 sec /
> iter
> <508> ./example.rb
> RubyInline 1.0.4
> Building /tmp/Mod_MyTest_fastfact.so with 'cc -shared -O -pipe  -fPIC
> -I /usr/local/lib/ruby/1.6/i386-freebsd4'
> Type = Inline, Iter = 1000000, time = 5.40564900 sec, 0.00000541 sec /
> iter
> <509> ./example.rb
> RubyInline 1.0.4
> Type = Inline, Iter = 1000000, time = 5.27179200 sec, 0.00000527 sec /
> iter
> 
> I'd love feedback and fixes for other platforms! The project is on
> sourceforge at http://sourceforge.net/projects/rubyinline/

Reply via email to