Re: [jruby-dev] Cleaning up our Java-implemented methods

2007-06-12 Thread Nick Sieger
On 6/12/07, Ola Bini <[EMAIL PROTECTED]> wrote: So, anyone who have looked at our code knows that an annoying part of the setup of each Ruby class is a long list of CallbackFactory calls. Brixen of Rubinius just showed me part of their FFI, which would make total sense for our purposes. What the

Re: [jruby-dev] Cleaning up our Java-implemented methods

2007-06-12 Thread Anders Bengtsson
--- Ola Bini <[EMAIL PROTECTED]> wrote: > In our case, we could have a part of Kernel look like this: > > module Kernel > attach_method "org.jruby.RubyKernel", "new_array", :Array, > [:object] > attach_method "org.jruby.RubyKernel", "new_float", :Float, > [:object] > end > > I think that wo

Re: [jruby-dev] Cleaning up our Java-implemented methods

2007-06-12 Thread Kresten Krab Thorup (Trifork)
I agree this is much cleaner; ideally everything should be done this way -- even core methods. The only trouble is the bootstrap process: some methods must be there before even the code below will work. In rubinius -- have thay figured out a good mechanism to control bootstrap for this?

[jruby-dev] Cleaning up our Java-implemented methods

2007-06-12 Thread Ola Bini
Hi guys. So, anyone who have looked at our code knows that an annoying part of the setup of each Ruby class is a long list of CallbackFactory calls. Brixen of Rubinius just showed me part of their FFI, which would make total sense for our purposes. What the example looks like is this: s = Co