After many hours of debugging I���ve finally discovered that Pharo���s implementation of #replaceFrom:to:with:startingAt: does not make any check for overlapping regions to avoid destructive operations.
| bytes |
bytes := #(1 2 3 4 5 6 7 8) copy.
bytes replaceFrom: 4 to: 7 with: bytes startingAt: 1.
bytes
"#(1 2 3 1 2 3 1 8) in Pharo"
"#(1 2 3 1 2 3 4 8) in GemStone���
While it isn���t the implementation I would choose, at least now I know!
James Foster