[squeak-dev] replaceFrom:to:with:startingAt:

Ron Teitelbaum ron at usmedrec.com
Mon Sep 22 20:21:27 UTC 2014


> From: Bert Freudenberg
> Sent: Monday, September 22, 2014 4:00 PM
> 
> I just found out why PNG decoding was broken in SqueakJS [*]. Wouldn't
> have believed that any code actually relied on the following behavior:
> 
> 	| a |
> 	a := (1 to: 20) asArray.
> 	a replaceFrom: 11 to: 20 with: a startingAt: 8.
> 
> 	==> #(1 2 3 4 5 6 7 8 9 10 8 9 10 8 9 10 8 9 10 8)
> 
That's funky!  Hope it wasn't my code!  Seems wrong to not copy the array
before modifying it  (Like your buggy VM did).

Ron

> In my (buggy) VM it answered
> 
> 	==> #(1 2 3 4 5 6 7 8 9 10 8 9 10 11 12 13 14 15 16 17)
> 
> which apparently did not at all match what The Creators intended ;)
> 
> - Bert -
> 
> [*] specifically, #decompressBlock:with:



More information about the Squeak-dev mailing list