[#38392] Enumerable#gather_each — Tanaka Akira <akr@...>

ときに、複数行をまとめて扱いたいことがあります。

47 messages 2009/05/09
[#38394] Re: Enumerable#gather_each — ujihisa <ujihisa@...> 2009/05/09

ujihisaと申します。

[#38400] Re: Enumerable#gather_each — Yukihiro Matsumoto <matz@...> 2009/05/09

まつもと ゆきひろです

[#38399] Re: Enumerable#gather_each — "Akinori MUSHA" <knu@...> 2009/05/09

At Sat, 9 May 2009 15:30:20 +0900,

[#38405] Re: Enumerable#gather_each — Tanaka Akira <akr@...> 2009/05/10

In article <86r5yy2nrg.knu@iDaemons.org>,

[#38417] Re: Enumerable#gather_each — "Akinori MUSHA" <knu@...> 2009/05/10

At Sun, 10 May 2009 10:08:47 +0900,

[#38524] [Bug #1503] -Kuをつけた時、/[#{s}]/n と Regexp.new("[#{s}]",nil,"n") で実行結果が異なる — sinnichi eguchi <redmine@...>

Bug #1503: -Kuをつけた時、/[#{s}]/n と Regexp.new("[#{s}]",nil,"n") で実行結果が異なる

8 messages 2009/05/22

[ruby-dev:38414] Re: Enumerable#gather_each

From: "NARUSE, Yui" <naruse@...>
Date: 2009-05-10 03:53:00 UTC
List: ruby-dev #38414
成瀬です。

Tanaka Akira wrote:
> In article <E1M2t0u-0000Aa-Sd@x61.netlab.jp>,
>   Yukihiro Matsumoto <matz@ruby-lang.org> writes:
> 
>> だけだと情報があまりにもないので手元のシソーラスでgatherを引
>> いたところ、
>>
>> accumulate, aggregate, amass, assemble, associate, bunch up,
>> capture, choose, close with, cluster, collect, concentrate,
>> congregate, convence, converge, corral, crowd, cull, draw,
>> draw in, flock, forgather, gang up, garner, get together,
>> group, hang around, hang out, heap, herd, hoard, huddle, ake
>> the scene, marshal, mass, meet, muster, pick, pile up,
>> pluck, poke, pour in, punch, rally, reunite, round up, scare
>> up, scrape together, show up, stack up, stockpile, swarm,
>> throng, unite
>>
>> とありました。明らかに違うだろうとか、別の意味で使ってるとか
>> いうものもありますが、参考までに。
> 
> この中だと、accumulate, aggregate, pour, unite あたりはどう
> ですかね。

その4つだとaggregateが好みかなぁ。
まぁ、gatherの用法を見ていると大雑把な語のようにも見えるので、
わたしはgatherでもいいかなぁと思い始めてもいます。
http://dic.yahoo.co.jp/dsearch?enc=UTF-8&p=gather&dtype=1

辞書を操ると、「同種の物をまとめる」風の意味のbunchとsheafとかありますね。
http://dic.yahoo.co.jp/dsearch?enc=UTF-8&p=bunch&dtype=1
http://dic.yahoo.co.jp/dsearch?enc=UTF-8&p=sheaf&dtype=1
全体でなく適当に束にする感じ

> 他には each_slice から語を借用して slice もしくは slice_by
> はどうでしょうか?

直前で切るーだとslice_beforeとかの方がしっくり来るんですが、
田中さんのgatherをsliceなんちゃらにしてしまうと違う感じですね。

-- 
NARUSE, Yui  <naruse@airemix.jp>

In This Thread