<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 05.01.2018 um 16:53 schrieb Clément Bera <<a href="mailto:bera.clement@gmail.com" class="">bera.clement@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Jan 5, 2018 at 4:05 PM, Norbert Hartl<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:norbert@hartl.name" target="_blank" class="">norbert@hartl.name</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"> <br class=""><div style="word-wrap: break-word; line-break: after-white-space;" class="">You mean<div class=""><br class=""></div><div class=""><div class=""><span class="m_8231836668159255930Apple-tab-span" style="white-space: pre-wrap;">   </span><primitive: 174 error: ec></div><div class=""><span class="m_8231836668159255930Apple-tab-span" style="white-space: pre-wrap;">      </span>self isReadOnlyObject </div><div class=""><span class="m_8231836668159255930Apple-tab-span" style="white-space: pre-wrap;">           </span>ifTrue: [(ModificationForbidden for: self atInstVar: index with: anObject) signal]</div><div class=""><span class="m_8231836668159255930Apple-tab-span" style="white-space: pre-wrap;">            </span>ifFalse: [ self primitiveFailed ]</div><div class="">?</div><div class=""><br class=""></div><div class="">Norbert</div></div></div></blockquote><div class=""><br class=""></div><div class="">yes something like that.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Same thing for Object>>#at:put:, floatAt:put: and so on.</div></div></div></blockquote><div><br class=""></div>I’m working on it and came by</div><div><br class=""></div><div>Object>>#primitiveChangeClassTo:</div><div><br class=""></div><div>and I wonder what would be the approach here. The ModificationForbidden/NoModificationError seems to be tight to an index. What would be the case for a class change? Another Exception class? How is that solved in VW? </div><div><br class=""></div><div>Norbert</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">Am 05.01.2018 um 14:22 schrieb Clément Bera <<a href="mailto:bera.clement@gmail.com" target="_blank" class="">bera.clement@gmail.com</a>>:</div><br class="m_8231836668159255930Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">No this is not a bug.</div><div class=""><br class=""></div>This needs to be handled in the primitive failure code in the image, the method should be something like that :<div class=""><br class=""><div class=""><div class=""><font face="monospace, monospace" class="">Object>>instVarAt: index put: anObject</font></div><div class=""><font face="monospace, monospace" class=""><span style="white-space: pre-wrap;" class="">       </span><primitive: 174 error: ec></font></div><div class=""><font face="monospace, monospace" class="">       <span class="Apple-converted-space"> </span>self isReadOnlyObject ifTrue: [(ModificationForbidden for: self atInstVar: index with: anObject) signal]</font></div><div class=""><font face="monospace, monospace" class=""><span style="white-space: pre-wrap;" class=""> </span>self primitiveFailed</font></div><div class=""><br class=""></div><div class="">All primitive fall-back code triggering object mutation should be rewritten this way, especially primitives such as #at:put:, #instVarAt:put:, etc.</div><div class=""><br class=""></div></div></div><div class="">Cheers</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Jan 5, 2018 at 1:42 PM, Norbert Hartl<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:norbert@hartl.name" target="_blank" class="">norbert@hartl.name</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"> <br class=""><div style="word-wrap: break-word; line-break: after-white-space;" class="">If I do <div class=""><br class=""></div><div class=""><div class="">(#foo -> #bar)</div><div class=""><span class="m_8231836668159255930m_-2406158539713268726Apple-tab-span" style="white-space: pre-wrap;">       </span>beReadOnlyObject;</div><div class=""><span class="m_8231836668159255930m_-2406158539713268726Apple-tab-span" style="white-space: pre-wrap;">       </span>value: #baz</div></div><div class=""><br class=""></div><div class="">it throws</div><div class=""><br class=""></div><div class=""><b class="">ModificationForbidden:  #foo->#bar is read-only, hence its field 2 cannot be modified with #baz</b></div><div class=""><br class=""></div><div class=""> which is as expected. But if I do</div><div class=""><br class=""></div><div class=""><div class="">(#foo -> #bar)</div><div class=""><span class="m_8231836668159255930m_-2406158539713268726Apple-tab-span" style="white-space: pre-wrap;"> </span>beReadOnlyObject;</div><div class=""><span class="m_8231836668159255930m_-2406158539713268726Apple-tab-span" style="white-space: pre-wrap;">       </span>instVarNamed: #value put: #baz</div></div><div class=""><br class=""></div><div class="">I get</div><div class=""><br class=""></div><div class=""><b class="">PrimitiveFailed: primitive #instVarAt:put: in Association failed</b></div><div class=""><br class=""></div><div class="">I think this a bug, no?</div><div class=""><br class=""></div><div class="">Norbert</div></div><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="m_8231836668159255930gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><span style="font-size: 12.8px;" class="">Clément Béra</span><div style="font-size: 12.8px;" class="">Pharo consortium engineer</div><div style="font-size: 12.8px;" class=""><a href="https://clementbera.wordpress.com/" target="_blank" class="">https://clementbera.wordpress.<wbr class="">com/</a><br class=""></div><div style="font-size: 12.8px;" class=""><span style="line-height: 16px;" class="">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight: bold; line-height: 16px;" class="">Villeneuve d'Ascq</span></div></div></div></div></div></blockquote></div><br class=""></div></div><br class=""></blockquote></div><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br clear="all" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_signature" data-smartmail="gmail_signature" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr" class=""><span style="font-size: 12.8px;" class="">Clément Béra</span><div style="font-size: 12.8px;" class="">Pharo consortium engineer</div><div style="font-size: 12.8px;" class=""><a href="https://clementbera.wordpress.com/" target="_blank" class="">https://clementbera.wordpress.com/</a><br class=""></div><div style="font-size: 12.8px;" class=""><span style="line-height: 16px;" class="">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight: bold; line-height: 16px;" class="">Villeneuve d'Ascq</span></div></div></div></div></blockquote></div><br class=""></body></html>