Hey all, I posted the results of some recent experimenting with IronRuby to my blog at: http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby. My question is, how do these things work under the covers? Do .NET types that have a Ruby equivalent get treated as the Ruby type or is there an extra layer that allows any .NET type to be modified at runtime? It''s totally cool that any of this is possible, but I was very surprised that it is. Thanks all! -- joe fiorini http://www.faithfulgeek.org // freelancing & knowledge sharing -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080618/86eeda81/attachment.html>
I left a comment on your blog, but I''ll answer here as well. IronRuby adds the Ruby Enumerable mixin to IEnumerable objects, which allows for CLR lists and collections to act more like Ruby arrays. And the new methods you add to CLR classes in IronRuby will not be available when calling them from a non-DLR language like C#. On Wed, Jun 18, 2008 at 8:13 AM, Joe Fiorini <joe at faithfulgeek.org> wrote:> Hey all, > I posted the results of some recent experimenting with IronRuby to my blog > at: http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby. My question > is, how do these things work under the covers? Do .NET types that have a > Ruby equivalent get treated as the Ruby type or is there an extra layer that > allows any .NET type to be modified at runtime? It''s totally cool that any > of this is possible, but I was very surprised that it is. > > Thanks all! > > -- > joe fiorini > http://www.faithfulgeek.org > // freelancing & knowledge sharing > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080618/5e8835c3/attachment.html>
We wouldn''t be very true to Ruby if we didn''t allow you to "monkey patch" CLR classes and interfaces. And really, this isn''t all that different than using extension methods in C#. All classes in IronRuby have a "RubyClass" object associated with them, even if the class is being imported from the CLR. It''s this object that defines and manages the Ruby aspects of the class implementation. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Joe Fiorini Sent: Wednesday, June 18, 2008 7:14 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Evil Fun with IronRuby Hey all, I posted the results of some recent experimenting with IronRuby to my blog at: http://faithfulgeek.org/2008/6/17/evil-fun-with-ironruby. My question is, how do these things work under the covers? Do .NET types that have a Ruby equivalent get treated as the Ruby type or is there an extra layer that allows any .NET type to be modified at runtime? It''s totally cool that any of this is possible, but I was very surprised that it is. Thanks all! -- joe fiorini http://www.faithfulgeek.org // freelancing & knowledge sharing -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080618/fa63a720/attachment.html>