<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 23 juin 2020 à 19:32, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> a écrit :<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 dir="ltr"><div dir="ltr"><div dir="ltr">Hi Nicolas,<br><div><br></div><div>   on reviewing this code first I really like transformInAssignmentTo: ; it's a much nicer design than my hack.  Now, a specific issue...</div><div><br></div><div>I see </div><div><div>TReturnNode>>transformInAssignmentTo: aTVariableNode</div><div><span style="white-space:pre-wrap">   </span>"a return shall not be assigned:</div><div><span style="white-space:pre-wrap">            </span>x := condition ifTrue: [^nil] ifFalse: [2]</div><div><span style="white-space:pre-wrap">       </span>shall be transformed into:</div><div><span style="white-space:pre-wrap">               </span>condition ifTrue: [^nil] ifFalse: [x := 2]"</div><div><span style="white-space:pre-wrap"> </span></div><div><span style="white-space:pre-wrap"> </span>^self</div></div><div><br></div><div>The issue here is that if x is a global variable then a necessary side-effect will be lost.  Hence I think we need to refactor transformInAssignmentTo: to transformInAssignmentTo:codeGen: so that we can query whether the variable is in fact global in the current scope.</div></div></div></div></div><br></blockquote><div>Hi Eliot,</div><div>I do not really understand the concern here...</div><div>I fail to see the relation with the lifetime of the variable</div>Do you have an example?</div><div class="gmail_quote">Or does it interfere with some inlining tricks?<br></div></div>