Re: [jruby-dev] A bug about if

2007-07-15 Thread Charles Oliver Nutter
dreamhead wrote: Hi! Here is a bug from a Chinese Forum.It's the link if you can read Chinese. :) http://www.javaeye.com/topic/101327 if "string" puts "true" else puts "false" end C Ruby: true JRuby: false We know all objects should be true except false and nil, so it's a bug. I have d

[jruby-dev] A bug about if

2007-07-15 Thread dreamhead
Hi! Here is a bug from a Chinese Forum.It's the link if you can read Chinese. :) http://www.javaeye.com/topic/101327 if "string" puts "true" else puts "false" end C Ruby: true JRuby: false We know all objects should be true except false and nil, so it's a bug. I have debugged the code. Th

[jruby-dev] A choice of two serialization/persistence strategies

2007-07-15 Thread Alan McKean
I currently have two strategies implemented for serialization and persistence. Both require storing the runtime in a thread local variable 'currentRuntime'. They fetch the runtime from there when they need it via a Ruby.getCurrentRuntime() call. I would like to hear your critiques and comm

[jruby-dev] How to wrap a Java class for use in Ruby?

2007-07-15 Thread Alan McKean
We use a concurrent HashMap in our persistence to control concurrent access to the persistent object by multiple users. It's called CuHashMap. I assume that I need to create a RubyClass that dispatches to it because I get a NullPointerException (no metaclass) when I try to store objects in

[jruby-dev] Example persistence code

2007-07-15 Thread Alan McKean
Here is the sample code that I have been using to persist some simple objects: To write persistent objects require 'java' require 'employee' require 'persistence' include Persistence persistent 'people' person = Person.new('Alan') employee = Employee.new('Bob', 12345) @people.store(person) @

[jruby-dev] Fruits of compiler labor

2007-07-15 Thread Charles Oliver Nutter
(blogged also) Compilers are hard. But not so hard as people would have you believe. I've committed an update that installs a CallAdapter for every compiled call site. CallAdapter is basically an abstract class that stores the following: - method name - method index - call type (normal, func