From: KONTRA Gergely Date: 2003-04-15T02:51:49+09:00 Subject: [Q] Array default values, << and <<= Hi! I've found a nice solution to have arrays and hashes a nice default value, but I'm now confused. Now, I use ruby 1.8 irb(main):004:0> b=Hash.new([]) => {} irb(main):005:0> b[1] << 1 => [1] irb(main):006:0> b # Where is the one? => {} irb(main):007:0> b[1] <<= 1 => [1, 1] So my confusion: rb(main):001:0> a=[1,2] => [1, 2] irb(main):002:0> a << 3 => [1, 2, 3] irb(main):003:0> a => [1, 2, 3] So what << and <<= exactly do? Gergo -- +-[ Kontra, Gergely PhD student Room IB113 ]---------+ | http://www.mcl.hu/~kgergely "Olyan langesz vagyok, hogy | | Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom" | +---Magyar php mirror es magyar php dokumentacio: http://hu.php.net---+