From: "ara.t.howard" Date: 2008-07-26T00:14:09+09:00 Subject: Re: Interesting Array Initialization Typo On Jul 25, 2008, at 8:58 AM, Maciej Tomaka wrote: > When initializing for example : [ [1, 2], [2, 3], [3, 2] ] > > You may forget about one colon, you will get: > >>> [ [1, 2] [2, 3], [3, 2] ] > => [[], [3, 2]] > > No syntax error:) No warnings here, beware! :) > -- > Posted via http://www.ruby-forum.com/. > it's not a syntax error, it's the same as this cfp:~ > ruby -e' p( ( array = [1,2] )[ index = [2,3] ] ) ' which is the same as cfp:~ > ruby -e' array = [1,2]; index = [2,3]; p array[*index]' [] [1, 2] [2, 3] is the array '[1,2]' indexed by '2,3' a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama