<div dir="ltr">2018-01-10 11:15 GMT+01:00 Denis Kudriashov <span dir="ltr"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span>:<br><div class="gmail_extra"><div class="gmail_quote"><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 dir="ltr"><div>So I would introduce little hierarchy which I already mentioned:</div><div><br></div><div>ModificationForbidden</div><div>   FieldModificationForbidden</div><div>   ClassModificationForbidden</div><div>   BecomeModificationForbidden</div><div><br></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">On the base class there will be object, newValue, retrySelector and isMirror flag. And fieldIndex will be moved to the FieldModificationForbidden.</span><br></div><div><font color="#24292e" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><span style="font-size:14px">Mirror flag is required to correctly retry mirror based modification because first argument in that case is always "actual receiver" instead of index.</span></font></div></div></blockquote><div><br></div><div>I was not correct about mirrors case. It can be handled without flag. For example:</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><div>Context class >> object: anObject basicAt: index put: aValue</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>     "......"</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>     anObject isReadOnlyObject </div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span>ifTrue: [ ^ (ModificationForbidden new</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>object: anObject;</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                             </span>fieldIndex: index;</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                            </span>newValue: value;</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                              </span>retrySelector: #basicAt:put:) signal ].</div></div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>But this simplification can break some scenarios because users of mirrors do not want direct interaction with given object. But retry operation will force it with direct message.</div><div><br></div></div></div></div>