Ivan Porto Carrero
2008-Aug-20 07:53 UTC
[Ironruby-core] sorting of strings is different in IronRuby than in Ruby
Hi I was playing around with a very simple code example and got different results in IronRuby and in Ruby. "IronRuby In Action".split(//).sort.uniq.join returns in MRI: " AIRbcinortuy" returns in IronRuby: " AbciInorRtuy" I''m sure you guys are aware of this, but just in case :) I guess in the end the 2 results should be the same or is this perhaps something that has to do with encoding? Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080820/26d183e8/attachment.html>
Curt Hagenlocher
2008-Aug-20 23:27 UTC
[Ironruby-core] sorting of strings is different in IronRuby than in Ruby
We end up calling String.CompareTo which performs a lexicographical comparison. This is the source of the different behavior. This should be filed as a bug in RubyForge if it hasn?t been already. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Wednesday, August 20, 2008 12:54 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] sorting of strings is different in IronRuby than in Ruby Hi I was playing around with a very simple code example and got different results in IronRuby and in Ruby. "IronRuby In Action".split(//).sort.uniq.join returns in MRI: " AIRbcinortuy" returns in IronRuby: " AbciInorRtuy" I''m sure you guys are aware of this, but just in case :) I guess in the end the 2 results should be the same or is this perhaps something that has to do with encoding? Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080820/9d41c8ff/attachment.html>