<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Christoph --<div><br></div><div>> <span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"> </span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">IMHO, it unnecessarily complicates the simple Smalltalk syntax.</span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">  [...]</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Nah, this is just a tooling change, not a syntactical one. </span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Yes, I would like to have this info skipped for #isNil as well. Note that o</span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">ne should not use  #ifNotNilDo: anymore.</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Best,</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Marcel</span></div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 23.11.2022 11:00:43 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">


<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif">
<p>Hi Eliot, hi all,</p>
<p><br>
</p>
<p>I'm skeptical about this change, as it creates or expands a special role of the selectors #ifNil:, #ifNotNil:, and their combinations. IMHO, it unnecessarily complicates the simple Smalltalk syntax. While I know and sometimes dislike these UndefinedVariable
 notifications, too, I don't know whether differentiating them by the selector is the right strategy to improve this situation.</p>
<p><br>
</p>
<p>Consider the following examples:</p>
<p><br>
</p>
<p></p>
<div></div>
<div></div>
<div>| a b c d e f g h |</div>
<div>a ifNil: [a := 1].</div>
<div>c := b.</div>
<div>c ifNil: [c := 3].</div>
<div>#(1 2 3) sorted: d.</div>
<div>e := 5.</div>
<div>(e isNil or: [f isNil]) ifTrue: [e := f := 6].</div>
<div>g perform: #ifNotNil: with: [b := g].</div>
<div>h ifNotNilDo: [h := 8].</div>
<div></div>
<div></div>
<br>
<p></p>
<p>How would you explain to a naive Smalltalker which of these variables will be marked as undefined at this point and why? (Of course, you can explain it by pointing to the implementation, but I think that's a significantly less intuitive explanation than
 just saying "you must declare any variable before using it".)</p>
<p>This behavior leads to a mental model that disambiguates between null and undefined similar to JavaScript which I never have found helpful.</p>
<p>Also, with this change, the compiler leaks the default value of any temporary variable, which we previously were able to hide at least partially.</p>
<p>In many cases, I think explicitly setting a temporary variable to nil before it is initialized within some non-trivial conditional complex would be more explicit, thus more readable, and something which we should generally encourage programmers to do.</p>
<p><br>
</p>
<p>Looking forward to your opinion!</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Mittwoch, 23. November 2022 04:10:30<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Compiler-eem.480.mcz</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText">Eliot Miranda uploaded a new version of Compiler to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Compiler-eem.480.mcz">http://source.squeak.org/trunk/Compiler-eem.480.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Compiler-eem.480<br>
Author: eem<br>
Time: 22 November 2022, 7:10:27.324796 pm<br>
UUID: 3e5ba19e-c44a-4390-9004-de1246736cbc<br>
Ancestors: Compiler-eem.479<br>
<br>
Do not warn of an uninitialized temporary if it is being sent ifNil: or ifNotNil:.<br>
<br>
=============== Diff against Compiler-eem.479 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Parser>>primaryExpression (in category 'expression types') -----<br>
  primaryExpression <br>
         hereType == #word <br>
                 ifTrue: <br>
                         [parseNode := self variable.<br>
+                        (parseNode isUndefTemp<br>
+                         and: [(#('ifNil:' 'ifNotNil:') includes: here) not<br>
+                         and: [self interactive]])<br>
+                                ifTrue:<br>
+                                        [self queryUndefined].<br>
-                        (parseNode isUndefTemp and: [self interactive])<br>
-                                ifTrue: [self queryUndefined].<br>
                         parseNode nowHasRef.<br>
                         ^ true].<br>
         hereType == #leftBracket<br>
                 ifTrue: <br>
                         [self advance.<br>
                         self blockExpression.<br>
                         ^true].<br>
         hereType == #leftBrace<br>
                 ifTrue: <br>
                         [self braceExpression.<br>
                         ^true].<br>
         hereType == #leftParenthesis<br>
                 ifTrue: <br>
                         [self advance.<br>
                         self expression ifFalse: [^self expected: 'expression'].<br>
                         (self match: #rightParenthesis)<br>
                                 ifFalse: [^self expected: 'right parenthesis'].<br>
                         ^true].<br>
         (hereType == #string or: [hereType == #number or: [hereType == #literal or: [hereType == #character]]])<br>
                 ifTrue: <br>
                         [parseNode := encoder encodeLiteral: self advance.<br>
                         ^true].<br>
         (here == #- and: [tokenType == #number and: [1 + hereEnd = mark]])<br>
                 ifTrue: <br>
                         [self advance.<br>
                         parseNode := encoder encodeLiteral: self advance negated.<br>
                         ^true].<br>
         ^false!<br>
<br>
<br>
</div>
</span></span>
</div></blockquote></div>