Re: partition_by
From:
matz@... (Yukihiro Matsumoto)
Date:
2002-11-16 17:25:10 UTC
List:
ruby-core #579
Hi,
In message "Re: partition_by"
on 02/11/16, Anders Bengtsson <ndrsbngtssn@yahoo.se> writes:
|> (0..9).partition_by { |x| x % 3 }
|> ==>{0=>[0, 3, 6, 9], 1=>[1, 4, 7], 2=>[2, 5, 8]}
|We have a method just like that in JRuby, which we use a lot internally.
|But we've named it "group_by", inspired by SQL.
I prefer "group_by" to "partition_by". Could it be just "group",
since we have "select" not "select_by"?
matz.