[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 5:41:55
Message-ID: 200410120141.52282.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>
|
| Cheers,
| Kent.

Thanks Kent.

Well, well. How long has that been around? A bit long winded, but I guess I 
can use that to implement #each_by().

So now I'm wondering how #each arguments would work with that to get 
Enumerable functionality. I'll have to give it some thought and play with 
this new toy.

Thanks again,
T.

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

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