[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Strange ruby-1.9.1 array substitution answer

Yukihiro Matsumoto

5/28/2009 10:21:00 PM

Hi,

In message "Re: Strange ruby-1.9.1 array substitution answer"
on Fri, 29 May 2009 03:06:18 +0900, Michel Demazure <michel@demazure.com> writes:

|Strange !
|
|arr = [1,2,3,4,5]
|arr[0,2] = nil
|=> ruby 1.8 : arr = [3,4,5]
|=> ruby 1.9 : arr = [nil, 3,4,5]

It's a behavior change in 1.9, use

arr[0,2] = []

instead.

matz.

1 Answer

Michel Demazure

5/29/2009 5:58:00 AM

0

Yukihiro Matsumoto wrote:
>
> It's a behavior change in 1.9, use
>
> arr[0,2] = []
>
> instead.
>
> matz.

Thanks, Matz.
It is exactly what I did.
I was not aware of the change ... or I forgot.

M.
--
Posted via http://www.ruby-....