[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    Re: ANN: Free-form-operators patch
From:       "trans.  (T. Onoma)" <transami () runbox ! com>
Date:       2004-10-12 17:51:09
Message-ID: 200410121351.03378.transami () runbox ! com
[Download RAW message or body]

On Tuesday 12 October 2004 01:10 am, Kent Sibilev wrote:
| $ irb -r enumerator
| irb(main):001:0> (1..10).enum_slice(2).each do |v1, v2|
| irb(main):002:1* puts "#{v1} #{v2}"
| irb(main):003:1> end
| 1 2
| 3 4
| 5 6
| 7 8
| 9 10
| => nil
| irb(main):004:0>

I appears that require 'enumerator' adds to Enumerable module. Is there any 
way to include the enumerator's functionality into my own version of the 
Enumerable module?

  module Enumerable2
    include ???Enumorator
    def select
      ...

I'm expirementing with variations on #each, but I can't overwrite the 
Enumerable module itself b/c test/unit fails if I do.

T.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic