<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi Christoph.<div class="mb_sig"></div>
                                        
                                        <div><br></div><div>> <span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">actually, I love the Dictionary API with the #ifPresent:ifAbsent: arguments as it is very convenient for describing the code paths</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">The terms "at" or "at if present" are quite generic while "class named" reads domain specific. So, #classNamed: can improve code readability. And once you are in that domain, as Levente mentioned, you can then support things such as metaclass lookup using the same interface. :-) That would be awkward (or at least unexpected and surprising) through #at:ifPresent: ...</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div>> <span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">If you think it is important to distinguish between classes and globals</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Classes are a special kind of global variable. Yes, this domain knowledge should be represented in the interface.</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">>  </span><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">maybe we should also introduce #classNamed:[ifPresent:][ifAbsent:] (three variants) to SmalltalkImage? But this would be a lot of "forwarding noise"</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">I don't think that we need that change. Programmers can write quite readable code using #hasClassNamed: and #classNamed:.</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Best,</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Marcel</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></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 17.02.2020 00:17:02 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 Levente,</p>
<p><br>
</p>
<p>actually, I love the Dictionary API with the #ifPresent:ifAbsent: arguments as it is very convenient for describing the code paths (IMHO). As you may have seen, I am trying to establish it for more domains (see <span>Collections-ct.873, <span>Collections-ct.872, <span>Collections-ct.875).</span></span></span></p>
<p><br>
</p>
<div id="x_Signature">
<div dir="ltr" id="x_divtagdefaultwrapper" style="font-size: 12pt;color: rgb(0,0,0);font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div>
<div id="x_Item.MessagePartBody" class="x__rp_T4">If you think it is important to distinguish between classes and globals, maybe we should also introduce #classNamed:[ifPresent:][ifAbsent:] (three variants) to SmalltalkImage? But this would be a lot of "forwarding
 noise".
<div id="x_Item.MessageUniqueBody" class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><span style="font-family: Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</span></div>
</div>
</div>
</div>
<div id="x_Item.MessagePartBody" class="x__rp_T4"><br>
</div>
<div id="x_Item.MessagePartBody" class="x__rp_T4">Best,</div>
<div id="x_Item.MessagePartBody" class="x__rp_T4">Christoph</div>
</div>
<div><span style="color: #808080;font-size: 10pt"></span></div>
</div>
</div>
</div>
</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 Levente Uzonyi <leves@caesar.elte.hu><br>
<b>Gesendet:</b> Sonntag, 16. Februar 2020 22:39:13<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Compiler-ct.418.mcz</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText">Hi Christoph,<br>
<br>
The idea with Environments was to move away from the SystemDictionary API. <br>
It obviously didn't happen, but there's #classNamed: for class lookup by <br>
name. Actually #classNamed: was there with SystemDictionary too, but it <br>
was and still is underused.<br>
<br>
Levente<br>
<br>
On Sun, 16 Feb 2020, commits@source.squeak.org wrote:<br>
<br>
> Christoph Thiede uploaded a new version of Compiler to project The Inbox:<br>
> <a href="http://source.squeak.org/inbox/Compiler-ct.418.mcz">http://source.squeak.org/inbox/Compiler-ct.418.mcz</a><br>
><br>
> ==================== Summary ====================<br>
><br>
> Name: Compiler-ct.418<br>
> Author: ct<br>
> Time: 16 February 2020, 3:49:08.315 pm<br>
> UUID: 3ca7ba74-6e8b-f64d-bc62-701ebc5df3e0<br>
> Ancestors: Compiler-eem.416<br>
><br>
> Small refactoring: Use SmalltalkImage >> #at:ifPresent:ifAbsent:.<br>
><br>
> =============== Diff against Compiler-eem.416 ===============<br>
><br>
> Item was changed:<br>
>  ----- Method: Compiler>>evaluateCue:ifFail: (in category 'private') -----<br>
>  evaluateCue: aCue ifFail: failBlock<br>
>        "Compiles the cue source into a parse tree, then generates code into<br>
>        a method. Finally, the compiled method is invoked from here via  withArgs:executeMethod:, hence the system no longer creates Doit method<br>
>        litter on errors."<br>
><br>
>        | methodNode method value |<br>
>        methodNode := self compileCue: aCue noPattern: true ifFail: [^failBlock value].<br>
><br>
>        method := self interactive<br>
>                                ifTrue: [methodNode generateWithTempNames]<br>
>                                ifFalse: [methodNode generate].<br>
><br>
>        value := cue receiver<br>
>                                withArgs: (cue context ifNil: [#()] ifNotNil: [{cue context}])<br>
>                                executeMethod: method.<br>
> +      ^ value!<br>
> -      ^ value<br>
> - !<br>
><br>
> Item was changed:<br>
>  ----- Method: MethodNode>>asColorizedSmalltalk80Text (in category 'converting') -----<br>
>  asColorizedSmalltalk80Text<br>
>        "Answer a colorized Smalltalk-80-syntax string description of the parse tree whose root is the receiver."<br>
><br>
>        | printText |<br>
>        printText := self printString asText.<br>
> +      ^ Smalltalk<br>
> +              at: #SHTextStylerST80<br>
> +              ifPresent: [:stylerClass | stylerClass new styledTextFor: printText]<br>
> +              ifAbsent: [printText]!<br>
> -      ^(Smalltalk at: #SHTextStylerST80 ifAbsent: [nil])<br>
> -              ifNotNil: [:stylerClass| stylerClass new styledTextFor: printText]<br>
> -              ifNil: [printText]!<br>
<br>
</div>
</span></span>
</div></blockquote></div>