Hey guys, I seem to have IronRuby name mangling in a rather inconsistent state. I was under the impression it would automagically work, but it seems it only changed the array #methods returns and not the actual methods it responds to...>>> BWAPI::Bwapi.BWAPIClient.is_connected(ir):1: undefined method `is_connected'' for BWAPI.Client:BWAPI::Client (NoMethod Error)>>> BWAPI::Bwapi.BWAPIClient.isConnected=> false>>> BWAPI::Bwapi.BWAPIClient.respond_to? :isConnected=> true>>> BWAPI::Bwapi.BWAPIClient.respond_to? :is_connected=> false>>> BWAPI::Bwapi.BWAPIClient.methods - Object.new.methods=> [''finalize'', ''dispose'', ''get_hash_code'', ''equals'', ''=='', ''data='', ''data'', ''is _connected'', ''connect'', ''disconnect'', ''update'', ''swig_c_mem_own'', ''swig_c_mem_ow n='']>>> IRONRUBY_VERSION=> "1.1.1.0" So it does not respond to ''is_connected'' but ''is_connected'' is in the methods array. Anyone an idea what I could have missed? Greetings Tinco
You can download the dll''s + test source at: https://github.com/d-snp/bwapi-ironruby it requires no setup. (source of the dll''s is: http://code.google.com/p/bwapi-mono-bridge/ not mine) Cheers, Tinco On Tue, Nov 23, 2010 at 04:31, Tinco Andringa <mail at tinco.nl> wrote:> Hey guys, > > I seem to have IronRuby name mangling in a rather inconsistent state. > I was under the impression it would automagically work, but it seems > it only changed the array #methods returns and not the actual methods > it responds to... > >>>> BWAPI::Bwapi.BWAPIClient.is_connected > (ir):1: undefined method `is_connected'' for BWAPI.Client:BWAPI::Client (NoMethod > Error) >>>> BWAPI::Bwapi.BWAPIClient.isConnected > => false >>>> BWAPI::Bwapi.BWAPIClient.respond_to? :isConnected > => true >>>> BWAPI::Bwapi.BWAPIClient.respond_to? :is_connected > => false >>>> BWAPI::Bwapi.BWAPIClient.methods - Object.new.methods > => [''finalize'', ''dispose'', ''get_hash_code'', ''equals'', ''=='', ''data='', ''data'', ''is > _connected'', ''connect'', ''disconnect'', ''update'', ''swig_c_mem_own'', ''swig_c_mem_ow > n=''] >>>> IRONRUBY_VERSION > => "1.1.1.0" > > So it does not respond to ''is_connected'' but ''is_connected'' is in the > methods array. > > Anyone an idea what I could have missed? > > Greetings > Tinco >
The library doesn''t follow .NET naming conventions at all :(>>> BWAPI::Bwapi.BWAPIClient.respond_to? :isConnected=> true Client class has a method called "isConnected".>>> BWAPI::Bwapi.BWAPIClient.respond_to? :is_connected=> false Client doesn''t have a method "IsConnected" nor "is_connected" hence this returns false. You are right. The list of method names should not include "is_connected". I''ve filed a bug: http://ironruby.codeplex.com/workitem/5463 Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tinco Andringa Sent: Monday, November 22, 2010 7:31 PM To: ironruby-core Subject: [Ironruby-core] Name mangling seems broken Hey guys, I seem to have IronRuby name mangling in a rather inconsistent state. I was under the impression it would automagically work, but it seems it only changed the array #methods returns and not the actual methods it responds to...>>> BWAPI::Bwapi.BWAPIClient.is_connected(ir):1: undefined method `is_connected'' for BWAPI.Client:BWAPI::Client (NoMethod Error)>>> BWAPI::Bwapi.BWAPIClient.isConnected=> false>>> BWAPI::Bwapi.BWAPIClient.respond_to? :isConnected=> true>>> BWAPI::Bwapi.BWAPIClient.respond_to? :is_connected=> false>>> BWAPI::Bwapi.BWAPIClient.methods - Object.new.methods=> [''finalize'', ''dispose'', ''get_hash_code'', ''equals'', ''=='', ''data='', ''data'', ''is _connected'', ''connect'', ''disconnect'', ''update'', ''swig_c_mem_own'', ''swig_c_mem_ow n='']>>> IRONRUBY_VERSION=> "1.1.1.0" So it does not respond to ''is_connected'' but ''is_connected'' is in the methods array. Anyone an idea what I could have missed? Greetings Tinco _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
I agree this is a total pain in the ass :P The library is a wrapper around a c++ library generated by SWIG so that''s why the conventions are so blatantly disregarded. Thanks for dealing with this annoying edgecase :) Greetings, Tinco On Wed, Nov 24, 2010 at 02:43, Tomas Matousek <Tomas.Matousek at microsoft.com> wrote:> The library doesn''t follow .NET naming conventions at all :( > >>>> BWAPI::Bwapi.BWAPIClient.respond_to? :isConnected > => true > > Client class has a method called "isConnected". > >>>> BWAPI::Bwapi.BWAPIClient.respond_to? :is_connected > => false > > Client doesn''t have a method "IsConnected" nor "is_connected" hence this returns false. > > You are right. The list of method names should not include "is_connected". I''ve filed a bug: http://ironruby.codeplex.com/workitem/5463 > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tinco Andringa > Sent: Monday, November 22, 2010 7:31 PM > To: ironruby-core > Subject: [Ironruby-core] Name mangling seems broken > > Hey guys, > > I seem to have IronRuby name mangling in a rather inconsistent state. > I was under the impression it would automagically work, but it seems it only changed the array #methods returns and not the actual methods it responds to... > >>>> BWAPI::Bwapi.BWAPIClient.is_connected > (ir):1: undefined method `is_connected'' for BWAPI.Client:BWAPI::Client (NoMethod > Error) >>>> BWAPI::Bwapi.BWAPIClient.isConnected > => false >>>> BWAPI::Bwapi.BWAPIClient.respond_to? :isConnected > => true >>>> BWAPI::Bwapi.BWAPIClient.respond_to? :is_connected > => false >>>> BWAPI::Bwapi.BWAPIClient.methods - Object.new.methods > => [''finalize'', ''dispose'', ''get_hash_code'', ''equals'', ''=='', ''data='', ''data'', ''is _connected'', ''connect'', ''disconnect'', ''update'', ''swig_c_mem_own'', ''swig_c_mem_ow n=''] >>>> IRONRUBY_VERSION > => "1.1.1.0" > > So it does not respond to ''is_connected'' but ''is_connected'' is in the methods array. > > Anyone an idea what I could have missed? > > Greetings > Tinco > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >