<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hey Eliot,<div><br></div><div>recently, you chose #findInterned: over #lookup:. Can you recall how this happened? What is your opinion on this matter? :-)</div><div><br></div><div>Here is a remark from Levente about this from July 2019:</div><div><span style="font-size: 10pt"><a href="http://forum.world.st/The-Trunk-Morphic-mt-1491-mcz-tp5101075p5101089.html">http://forum.world.st/The-Trunk-Morphic-mt-1491-mcz-tp5101075p5101089.html</a></span><br></div><div><br></div><div>Best,</div><div>Marcel</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 13.04.2021 11:44:24 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</p><div style="font-family:Arial,Helvetica,sans-serif"><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
> <span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">May I suggest to classify them as private then?</span><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Hmm... #hasInterned:ifTrue: is "private" already. ;-) Maybe #findInterned: should be, too. Yet, soft-deprecation via "self flag: #deprecated" might be even better since both are actually implemented through #lookup:. </span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">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 13.04.2021 11:25:27 schrieb Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">Le mar. 13 avr. 2021 à 10:51, <commits@source.squeak.org> a écrit :<br>><br>> Marcel Taeumel uploaded a new version of Tests to project The Trunk:<br>> http://source.squeak.org/trunk/Tests-mt.449.mcz<br>><br>> ==================== Summary ====================<br>><br>> Name: Tests-mt.449<br>> Author: mt<br>> Time: 13 April 2021, 10:51:15.223811 am<br>> UUID: 23984a3a-fc1c-2a44-a023-9862b3d2ba8d<br>> Ancestors: Tests-nice.448<br>><br>> Simplify #testUnknownSelector. Avoid interfering with garbage collection and symbol tables.<br>><br>> (Note that #lookup: is the preferred interface, not #findInterned: or #hasInterned:ifTrue:. The concept of internalization should not leak into client code.)<br><br>May I suggest to classify them as private then?<br><br>><br>> =============== Diff against Tests-nice.448 ===============<br>><br>> Item was changed:<br>> TestCase subclass: #CompilerExceptionsTest<br>> + instanceVariableNames: 'text selectionInterval originalText previousSelection originalSelection'<br>> - instanceVariableNames: 'text selectionInterval originalText previousSelection originalSelection tearDowns'<br>> classVariableNames: ''<br>> poolDictionaries: ''<br>> category: 'Tests-Compiler'!<br>><br>> Item was added:<br>> + ----- Method: CompilerExceptionsTest>>generateUnknownSelector (in category 'private') -----<br>> + generateUnknownSelector<br>> +<br>> + | selector num |<br>> + selector := 'yourself'.<br>> + num := 0.<br>> + [(Symbol lookup: selector, num) notNil] whileTrue: [num := num + 1].<br>> + ^ selector, num!<br>><br>> Item was removed:<br>> - ----- Method: CompilerExceptionsTest>>setUp (in category 'running') -----<br>> - setUp<br>> -<br>> - super setUp.<br>> - tearDowns := OrderedCollection new.<br>> - Symbol hasInterned: self unknownSelector ifTrue: [:symbol |<br>> - tearDowns add: [Symbol intern: symbol]].<br>> - Symbol extern: self unknownSelector.!<br>><br>> Item was changed:<br>> ----- Method: CompilerExceptionsTest>>tearDown (in category 'running') -----<br>> tearDown<br>><br>> self removeGeneratedMethods.<br>> - Symbol extern: self unknownSelector.<br>> - tearDowns do: #value.<br>> super tearDown.!<br>><br>> Item was changed:<br>> ----- Method: CompilerExceptionsTest>>testUnknownSelector (in category 'tests') -----<br>> testUnknownSelector<br>><br>> + | unknownSelector |<br>> + self flag: #flaky. "mt: This test depends on a list of suggestions that is derived from the system's known selectors. Any desired replacement might not be present in the actual list. Maybe we could use an index-based choice instead."<br>> + unknownSelector := self generateUnknownSelector.<br>> self<br>> + compiling: 'griffle self ' , unknownSelector<br>> - compiling: 'griffle self ' , self unknownSelector<br>> shouldRaise: UnknownSelector<br>> + andSelect: unknownSelector<br>> - andSelect: self unknownSelector<br>> testing: {<br>> + false -> [<br>> + self assertCanceled.<br>> + self assert: (Symbol lookup: unknownSelector) isNil].<br>> + 'yourself' -> [<br>> + self assertSucceeded: 'griffle self yourself'.<br>> + self assert: (Symbol lookup: unknownSelector) isNil].<br>> + unknownSelector -> [<br>> - false -> [self assertCanceled].<br>> - 'yourself' -> [self assertSucceeded: 'griffle self yourself'].<br>> - self unknownSelector -> [<br>> self assertSucceeded.<br>> + self assert: (Symbol lookup: unknownSelector) notNil] }.<br>> + unknownSelector := self generateUnknownSelector.<br>> - self assert: (Symbol hasInterned: self unknownSelector ifTrue: [:symbol |]).<br>> - Symbol extern: self unknownSelector] }.<br>> self<br>> + compiling: 'griffle [ self ' , unknownSelector , ' ] value'<br>> - compiling: 'griffle [ self ' , self unknownSelector , ' ] value'<br>> shouldRaise: UnknownSelector<br>> + andSelect: unknownSelector<br>> - andSelect: self unknownSelector<br>> testing: {<br>> + false -> [<br>> + self assertCanceled.<br>> + self assert: (Symbol lookup: unknownSelector) isNil].<br>> + 'yourself' -> [<br>> + self assertSucceeded: 'griffle [ self yourself ] value'.<br>> + self assert: (Symbol lookup: unknownSelector) isNil].<br>> + unknownSelector -> [<br>> - false -> [self assertCanceled].<br>> - 'yourself' -> [self assertSucceeded: 'griffle [ self yourself ] value'].<br>> - self unknownSelector -> [<br>> self assertSucceeded.<br>> + self assert: (Symbol lookup: unknownSelector) notNil] }.!<br>> - self assert: (Symbol hasInterned: self unknownSelector ifTrue: [:symbol |])] }.!<br>><br>> Item was removed:<br>> - ----- Method: CompilerExceptionsTest>>unknownSelector (in category 'private') -----<br>> - unknownSelector<br>> -<br>> - ^ 'yourrsellff'!<br>><br>> Item was removed:<br>> - ----- Method: Symbol class>>extern: (in category '*Tests-release') -----<br>> - extern: aStringOrSymbol<br>> -<br>> - {NewSymbols. SymbolTable} do: [:table |<br>> - table remove: aStringOrSymbol ifAbsent: []].!<br>><br>><br><br></commits@source.squeak.org></div></blockquote>
</div></div></blockquote></div>