I just upgraded an application to 2.3 RC2 and had several failing features stemming from ActiveSupport::Multibyte::Chars #eql? behaving differently in Ruby 1.8.x from 1.9. There was an old ticket with a patch and then some suggestions for fixing it that had be come stale, so I created a new patch incorporating the suggestion. http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1496 I''d appreciate it if someone could check it out and apply it for 2.3. Thanks, Brandon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Brandon, The reason I dropped Chars#eql? is because I wanted String#eql? and Chars#eql? to be symmetric. This can''t be done without redefining String#eql? and I felt at the time that redefining core lib methods might be a bit much. I guess if the core team doesn''t mind changing String#eql? I wouldn''t mind either. But the patch doesn''t really make and sense without it. I definately don''t feel alright with implementing Chars#hash, because of the internal optimizations of Hash in Ruby you can never get this to work consistently. It''s better to not support it at all than doing a half-assed job. If you want to implement eql?, please open a new ticket because the ticket you''re referring to was more about hash access than eql?. Manfred On Sun, Mar 8, 2009 at 5:43 AM, Brandon Keepers <brandon@opensoul.org> wrote:> > I just upgraded an application to 2.3 RC2 and had several failing > features stemming from ActiveSupport::Multibyte::Chars #eql? behaving > differently in Ruby 1.8.x from 1.9. > > There was an old ticket with a patch and then some suggestions for > fixing it that had be come stale, so I created a new patch > incorporating the suggestion. > > http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1496 > > I''d appreciate it if someone could check it out and apply it for 2.3.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
The issue that prompted me to revive this is actually related to hash
access. Here''s what I was doing:
@clients.group_by {|p| p.name.mb_chars.first }
This gives me back an array that is the same size as the original
@clients array because it sees each Chars string as different.
I understand your desire for it to be symmetric with String#eql?, but
I think that is a separate issue. I don''t feel strongly about it one
way or the other. At a minimum, #eql? and #hash should behave
properly when compared to another Chars object.
Brandon
On Mar 8, 2009, at 2:38 PM, Manfred Stienstra wrote:
>
> Hi Brandon,
>
> The reason I dropped Chars#eql? is because I wanted String#eql? and
> Chars#eql? to be symmetric. This can''t be done without redefining
> String#eql? and I felt at the time that redefining core lib methods
> might be a bit much.
>
> I guess if the core team doesn''t mind changing String#eql? I
wouldn''t
> mind either. But the patch doesn''t really make and sense without
it.
>
> I definately don''t feel alright with implementing Chars#hash,
because
> of the internal optimizations of Hash in Ruby you can never get this
> to work consistently. It''s better to not support it at all than
doing
> a half-assed job.
>
> If you want to implement eql?, please open a new ticket because the
> ticket you''re referring to was more about hash access than eql?.
>
> Manfred
>
> On Sun, Mar 8, 2009 at 5:43 AM, Brandon Keepers
> <brandon@opensoul.org> wrote:
>>
>> I just upgraded an application to 2.3 RC2 and had several failing
>> features stemming from ActiveSupport::Multibyte::Chars #eql? behaving
>> differently in Ruby 1.8.x from 1.9.
>>
>> There was an old ticket with a patch and then some suggestions for
>> fixing it that had be come stale, so I created a new patch
>> incorporating the suggestion.
>>
>> http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1496
>>
>> I''d appreciate it if someone could check it out and apply it
for 2.3.
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com
> To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
> -~----------~----~----~----~------~----~------~--~---
>