------art_122471_18866903.1154897451841
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 8/6/06, Marcelo Alvim <malvim / gmail.com> wrote:
>
> Hi,
>
> Sorry about the real newbie interrupting the high level thread, but...
>
> I liked very much the "eachn" method from Martin, and decided to test
> it out. I got a "Undefined method 'each_slice'" for the array. Went to
> ruby-doc.org, and the core docs have each_slice defined in module
> Enumerable. I have Ruby 1.8.4 installed. Does anyone know why is that
> not working for me?


Just a tiny little trap you fell into, look at this
 [1,2,3].each_slice(2){|s| p s}
NoMethodError: undefined method `each_slice' for [1, 2, 3]:Array
       from (irb):1

but


irb(main):003:0> require 'enumerator'
=> true
irb(main):004:0>  [1,2,3].each_slice(2){|s| p s}
[1, 2]
[3]

I have fallen into that one more than once and I still  will, it is a little
bit unclear why  Enumerable is not in the core while it is in the core doc.
But well just a minor hickup.

Cheers
Robert
[SNIP]



-- 
Deux choses sont infinies : l'univers et la bóŐise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.

- Albert Einstein

------art_122471_18866903.1154897451841--