<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">On Thu, Jul 20, 2017 at 12:46 PM, Bert Freudenberg </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">The problem is actually primitive 105, which allows this:<br></div></span><div class="gmail_extra"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><div><br></div><div>(ByteArray new: 10) replaceFrom: 1 to: 5 with: 'Hello'</div><div>=> #[72 101 108 108 111 0 0 0 0 0]</div></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">If you comment out the primitive call in ByteArray>>replaceFrom:to:<wbr>with:startingAt: and also remove Tim's at:put:, it will fail. So if a VM does not implement the (optional) primitive 105, the fallback code is wrong.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">Using #asInteger in ByteArray>>at:put: is a simple fix for that. Or we have to fix the fallback code in ByteArray>>replaceFrom:to:<wbr>with:startingAt:.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">I just committed the latter to the inbox but I'm not sure I like the implementation:</div><div><font color="#000000" face="arial, helvetica, sans-serif"><a href="http://source.squeak.org/inbox/Collections-bf.761.diff" target="_blank">http://source.squeak.org/<wbr>inbox/Collections-bf.761.diff</a></font></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">I take no response as silent ​agreement, so I moved this to trunk.</div></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">Also, ByteArray may not be the only class suffering from this problem:</div><div><font color="#000000" face="arial, helvetica, sans-serif">SystemNavigation default browseAllSelect: [:cm | cm primitive = 105]</font></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​Do we think these other places might need fixes?​</div></div></div><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -</div><br></div><div class="gmail_extra"><br></div></div>