Hi! the changeset 3727 removed the ordering on Enumerable::group_by (it now returns a Hash, instead of the Array previously, to be closer from the Ruby 1.9 behaviour). Is there any plan to add an ordered version back into the core ? Thibaut --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Aug 22, 2006 at 04:42:28PM +0200, Thibaut Barr�re wrote:> the changeset 3727 removed the ordering on Enumerable::group_by (it now > returns a Hash, instead of the Array previously, to be closer from the Ruby > 1.9 behaviour). > > Is there any plan to add an ordered version back into the core ?No plans that I know of. In the one app where I need the ordering to be preserved, I just redefined group_by to use the Array version. Another option is to call sort_by on the result but that can get ugly. marcel -- Marcel Molina Jr. <marcel@vernix.org> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thibaut.barrere@gmail.com
2006-Aug-22 15:11 UTC
[Rails-core] Re: Ordered Enumerable#group_by ?
> No plans that I know of. In the one app where I need the ordering to be > preserved, I just redefined group_by to use the Array version. Another > option is to call sort_by on the result but that can get ugly.ok then, I''ll keep my own copy. thanks! Thibaut --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/22/06, thibaut.barrere@gmail.com <thibaut.barrere@gmail.com> wrote:> > > > No plans that I know of. In the one app where I need the ordering to be > > preserved, I just redefined group_by to use the Array version. Another > > option is to call sort_by on the result but that can get ugly. > > ok then, I''ll keep my own copy.Cross your fingers for a native ordered hash (of whatever ilk, so long as it''s convenient ;) jeremy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Aug 22, 2006, at 12:15 PM, Jeremy Kemper wrote:> On 8/22/06, thibaut.barrere@gmail.com <thibaut.barrere@gmail.com> > wrote: > > > No plans that I know of. In the one app where I need the ordering > to be > > preserved, I just redefined group_by to use the Array version. > Another > > option is to call sort_by on the result but that can get ugly. > > ok then, I''ll keep my own copy. > > Cross your fingers for a native ordered hash (of whatever ilk, so > long as it''s convenient ;) > > jeremy >check out dictionary.rb from ruby facets library.. http://pastie.caboo.se/9128 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---