<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 15 août 2019 à 12:21, Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</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">On Thu, 15 Aug 2019, Tobias Pape wrote:<br>
<br>
><br>
>> On 15.08.2019, at 03:29, Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>> wrote:<br>
>> <br>
>> On Wed, 14 Aug 2019, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
>> <br>
>>> A new version of ShoutCore was added to project The Inbox:<br>
>>> <a href="http://source.squeak.org/inbox/ShoutCore-ct.69.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/ShoutCore-ct.69.mcz</a><br>
>>> <br>
>>> ==================== Summary ====================<br>
>>> <br>
>>> Name: ShoutCore-ct.69<br>
>>> Author: ct<br>
>>> Time: 14 August 2019, 10:43:04.7164 pm<br>
>>> UUID: 7d165f4e-09bf-a445-a664-5e8edb9867b8<br>
>>> Ancestors: ShoutCore-ul.68<br>
>>> <br>
>>> Fix bug in SHParserST80: Wrong styling after blocks with arguments without statements<br>
>> <br>
>> If you mean that Shout should accept [ :x ], then no, I'm pretty sure that's not valid smalltalk syntax, even if Parser accepts it.<br>
>> The vertical bar, even though I consider it unnecessary in all cases, is mandatory when there are arguments.<br>
><br>
> I only got to know this "shortcut syntax" because eliot used it either Cog or somewhere in trunk when preparing something (Spur? full block closures? I forgot). So this is a syntax idiosyncrasy that is in active use, not only "old code". <br>
><br>
> Either we forbid it in the parser and change all of the image or allow it in Shout.<br>
<br>
Can you give me examples?<br>
I suspect those are just typos, which the parser accidentally accepted <br>
(and Shout as well before my fixes).<br>
<br>
Levente<br>
<br></blockquote><div><br></div><div>I don't remember seeing this syntax before and found it a bit surprising.</div><div>So, for the sake of curiosity, I tried in some other dialects.</div><div><br></div><div>[:x ] is accepted syntax in</div><div>- Visualworks (8.3),</div><div>- Pharo (v7 with OpalCompiler)</div><div>- Smalltalk-80 (apple v0.?)<br></div><div><br></div><div>[:x ] is invalid in</div><div>- Dolphin</div><div>- Smalltalk/X (jv branch)<br></div><div><br></div><div>So it seems that it's something originating from original Smalltalk-80, but not reproducted in non derivated dialects...</div><div><br></div><div>The bar is mandatory in blue book specification (see the last pages)<br></div><div><br></div><div><div><img src="cid:ii_jzh40bqo0" alt="Capture d’écran 2019-08-18 à 17.11.53.png" width="473" height="63"><br></div></div><div>So it seems that implementation did not agree with specifications for ages...</div><div><div><img src="cid:ii_jzh7qdm71" alt="Capture d’écran 2019-08-18 à 18.56.05.png" width="473" height="304"><br></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
> Best regards<br>
>       -Tobias<br>
><br>
>> <br>
>> Levente<br>
>> <br>
>>> <br>
>>> Thanks Jakob for the report!<br>
>>> <br>
>>> =============== Diff against ShoutCore-ul.68 ===============<br>
>>> <br>
>>> Item was changed:<br>
>>> ----- Method: SHParserST80>>parseBlockArguments (in category 'parse') -----<br>
>>> parseBlockArguments<br>
>>><br>
>>>     currentTokenFirst == $: ifFalse: [ ^self ].<br>
>>>     [ currentTokenFirst == $: ] whileTrue: [<br>
>>>             self<br>
>>>                     scanPast: #blockArgColon;<br>
>>>                     parseArgument: #blockPatternArg ].<br>
>>> +   ((self parseVerticalBarForTemporaries: #blockArgsBar) and: [<br>
>>> +           currentTokenFirst ~= $] ])<br>
>>> +                   ifFalse: [<br>
>>> +                           self fail ": Missing block args bar" ]!<br>
>>> -   (self parseVerticalBarForTemporaries: #blockArgsBar) ifFalse: [<br>
>>> -           self fail ": Missing block args bar" ]!<br>
>><br>
<br>
</blockquote></div></div>