Home
Position: 主页>ruby>

creating an array of unique objects

Time:2010-01-22 03:24soucre:未知 作者:admin click:clicks
Newby question... When I try to create an array using this method... value = [1, 2] buffer = Array.new(10) {value} I get an array of references to the single instance of

   Newby question...
When I try to create an array using this method...

value = [1, 2]
buffer = Array.new(10) {value}

I get an array of references to the single instance of

------line----------------------------
Recommend
Hottest