[ruby-list:330] Re: Q. calling Find.find with array [Re: Reqest for Find and BUG report ]
From:
matz@... (Yukihiro Matsumoto)
Date:
1996-07-22 04:29:56 UTC
List:
ruby-list #330
まつもと ゆきひろです.
In message "[ruby-list:329] Q. calling Find.find with array [Re: Reqest for Find and BUG report ]"
on 96/07/22, 石塚圭樹 <keiju@shljapan.co.jp> writes:
|
|けいじゅ@SHLジャパンです.
|後者のようなことを実現したいと思った時に
|
|for arg in $FILE
| Find.find(arg){|file| ...
|end
|
|以外に, 何かエレガントな解決法はありませんか? lispのapplyやmapcarのよ
|うな...
変数filesがファイル名が入っている配列として
Find.find(*files){|file| ...}
でお望みのことができると思います.呼び出し側の`*'は配列を展
開するという意味があります.この場合も引数の配列はメソッド呼
び出しのコードでコピーされますので,cloneの必要はありません.