<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="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;" dir="ltr">
<p></p>
<div>> > +    ^ value!</div>
<div>> > -    ^ value</div>
<div>> > - !</div>
<div>> </div>
<div>> <3  these drive me nutz :-)</div>
<div>> </div>
<div>> IMO the UIs around compilation should strip trailing white space</div>
<div><br>
</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" 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="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">+1, we seem to do the same with leading whitespaces already.</div>
</div>
</div>
</div>
</div>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Eliot Miranda <eliot.miranda@gmail.com><br>
<b>Gesendet:</b> Mittwoch, 19. Februar 2020 11:58 Uhr<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Compiler-ct.418.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
<br>
> On Feb 16, 2020, at 3:31 PM, Levente Uzonyi <leves@caesar.elte.hu> wrote:<br>
> <br>
> Hi Christoph,<br>
> <br>
>> On Sun, 16 Feb 2020, Thiede, Christoph wrote:<br>
>> <br>
>> Hi Levente,<br>
>> 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<br>
>> (see Collections-ct.873, Collections-ct.872, Collections-ct.875).<br>
>> 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".<br>
> <br>
> In my opinion, #classNamed: is fine as-is, because when the class is available, the method will return it, when it's not, you'll get nil. No other return values are possible.<br>
> It also supports metaclass lookup, which is not available via #at:*.<br>
<br>
+1<br>
<br>
> <br>
> Levente<br>
> <br>
> <br>
>> Best,<br>
>> Christoph<br>
>> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________<br>
>> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves@caesar.elte.hu><br>
>> Gesendet: Sonntag, 16. Februar 2020 22:39:13<br>
>> An: squeak-dev@lists.squeakfoundation.org<br>
>> Betreff: Re: [squeak-dev] The Inbox: Compiler-ct.418.mcz  <br>
>> Hi Christoph,<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>
>> Levente<br>
>> On Sun, 16 Feb 2020, commits@source.squeak.org wrote:<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" id="LPlnk469900" previewremoved="true">
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>
<br>
</div>
</span></font></div>
</div>
</body>
</html>