Forum: Ruby-dev the length for an enumerator generated by Array#permutation and Array#combination

Posted by ko1 (Koichi Sasada) (Guest)
on 2012-10-26 22:14
(Received via mailing list)
Issue #2673 has been updated by ko1 (Koichi Sasada).

Description updated
Target version changed from 2.0.0 to next minor

I changed target to next minor because there is no discussion about it.
----------------------------------------
Feature #2673: the length for an enumerator generated by 
Array#permutation and Array#combination
https://bugs.ruby-lang.org/issues/2673#change-31638

Author: mrkn (Kenta Murata)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


=begin
 Array#permutation と Array#combination が生成する enumerator は要素数が確定できますが、
 Enumerator#length が存在しないため、to_a で配列化しなければ長さを取得できません。

 この欠点を解消するため、Array#permutation と Array#combination が生成する enumerator に対して
 length メソッドを特異メソッドとして追加するパッチを書きました。
 差し支えないようでしたら trunk への取り込みを検討し頂けませんでしょうか。

 よろしくお願いします。
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.