diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/mathn.rb | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Jan 9 22:04:17 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> + + * lib/mathn.rb (Prime#each): returns an enumerator if no block + given. [ruby-dev:32815] + Wed Jan 9 22:03:26 2008 NARUSE, Yui <naruse@ruby-lang.org> * encoding.c (rb_enc_replicate): replica of dummy is a dummy. diff --git a/lib/mathn.rb b/lib/mathn.rb index 1c68a4bb0..3e24dd03f 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -101,6 +101,7 @@ class Prime alias next succ def each + return to_enum(:each) unless block_given? loop do yield succ end |