[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02093] Re: Array Gotchas

From: "Dat Nguyen" <thucdat@...>
Date: 2000-03-23 02:20:10 UTC
List: ruby-talk #2093
Following was my exercise:

Ruby> ary = [1, 2, 3, 4, 5]
Ruby> ary.each_index {|i| print i, "\n"}
0
1
2
3
4
[1, 2, 3, 4, 5]
Ruby> (0..ary.size).each {|i| print i, "\n"}
0
1
2
3
4
5
0..5

Dat

>From: Dave Thomas <Dave@thomases.com>
>Reply-To: ruby-talk@netlab.co.jp
>To: ruby-talk@netlab.co.jp (ruby-talk ML)
>Subject: [ruby-talk:02092] Re: Array Gotchas
>Date: 22 Mar 2000 20:06:26 -0600
>
>"Dat Nguyen" <thucdat@hotmail.com> writes:
>
> > By chance, I also discovered a bug in the manual where it claims the
> > following are the same:
> >
> > each_index {...}
> > (0..ary.size).each {...}
> >
> > But they aren't. Do you see why?
>
>I'll bite. In what way are they different?
>
>
>Dave

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

In This Thread

Prev Next