part assigned sequence behavior puzzling
- To: mathgroup at smc.vnet.net
- Subject: [mg105228] part assigned sequence behavior puzzling
- From: mkr <mileskrains at gmail.com>
- Date: Wed, 25 Nov 2009 02:31:06 -0500 (EST)
I am puzzled by the following behavior: tmp = Range[15] tmp[[7]] = Sequence @@ Range[2]; tmp[[7]] = Sequence @@ Range[2]; tmp[[7]] = Sequence @@ Range[2]; tmp yields {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} {1, 2, 3, 4, 5, 6, 1, 2, 8, 9, 10, 11, 12, 13, 14, 15} I would have expected the repeated assignment to have a repeated effect, thus obtaining {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} {1, 2, 3, 4, 5, 6, 1, 2, 2, 2, 8, 9, 10, 11, 12, 13, 14, 15} Where/why am I wrong?