Orion Edwards
2011-Oct-31 03:34 UTC
[Ironruby-core] [ironlanguages-main] Ruby 1.9 marshalling compatibility. (630995e)
Hi Tomas (and other IronRuby devs). I''m trying to implement this, but I''m not sure quite how to go about dynamically invoking the ''message'' and ''backtrace'' methods on the other objects. It looks like the other methods all have a UnaryOpStorage or other kind of ''storage'' that they use to invoke other dynamic methods - how do I know what kind of Storage object I need to invoke methods on other objects? - I''m not sure where I get these storage objects from? It appears that in this case the language runtime will pass them in as needed, but if I need to call a ruby method from another location (eg inside Marshal.cs), how do I go about getting the storage object? Thanks, Orion From: Tomas Matousek <reply+c-683915-ae54ce679190ef3de090cba9240521883afb62af at reply.github.com> To: Gallagher Group R&D Department <orione at gallagher.co.nz> Date: 31/10/2011 06:55 a.m. Subject: Re: [ironlanguages-main] Ruby 1.9 marshalling compatibility. (630995e) This doesn''t seem to be quite right. Unfortunately Ruby''s exception object might be a bit messed up. Message might not be a string, backtrace is always an array (or nil) but it might not containg strings. It seems that Ruby calls "==" on the message object and then on each item of the backtrace. It doesn''t look like Ruby is comparing exception classes. Also an exception can be compared with any object that has "message" and "backtrace" methods. --- class C def message "hello" end def backtrace ["1","2","3"] end end class D def ==(other) p "==" true end end c = C.new m = D.new e = Exception.new(m) a = ["1","2","3"] e.set_backtrace(a) a[1] = D.new p e == c p e.backtrace.inspect, e.message p c.backtrace.inspect, c.message p IOError.new("1") == Exception.new("1") -- Reply to this email directly or view it on GitHub: https://github.com/gglresearchanddevelopment/ironlanguages-main/commit/630995eca293b5b0531e821b76bab7e15c4506f6#commitcomment-683915 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20111031/b6b41463/attachment.html>