<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI Emoji";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>> <span style="font-size: 12pt;">Yours removes the unpleasant duplication but as a reader I’d be happy for a comment why do nothing – which is not really “do nothing” but “return nil”.</span></p>
<div><br>
</div>
<div>Well then: on: Error do: [nil]. It's a matter of taste. :-)</div>
<p></p>
<p><br>
</p>
<p>> <span style="font-size: 12pt;">This is also equivalent 😊</span></p>
<div>>                 ^ ([self vmParameterAt: parameterIndex]</div>
<div>>                                 on: Error</div>
<div>>                                 do: [defaultValueOrBlock value]) ifNil: [defaultValueOrBlock value]</div>
<div><br>
</div>
<div>Provided that <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">defaultValueOrBlock value will not answer nil.
 :-) And if we wanted to preserve VM parameters that are set to nil (~= absent), we would need something like this instead:</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<div>[^ self vmParameterAt: parameterIndex]</div>
<div>    on: Error do: [].</div>
<div>^ defaultValueOrBlock value</div>
<div><br>
</div>
<div>But do we want to preserve explicit nil values here? Dave? Eliot? :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
</span></div>
<p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Jaromir Matas <outlook_43145B470FAFC36E@outlook.com> im Auftrag von Jaromir Matas <mail@jaromir.net><br>
<b>Gesendet:</b> Donnerstag, 16. Dezember 2021 23:27:47<br>
<b>An:</b> Thiede, Christoph; squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> RE: Regression | Cannot interrupt "[ [] repeat ] fork" anymore</font>
<div> </div>
</div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal">Haha, nice warmup exercise…</p>
<p class="MsoNormal">This is also equivalent <span style="font-family:"Segoe UI Emoji",sans-serif">
😊</span></p>
<p class="MsoNormal">                ^ ([self vmParameterAt: parameterIndex]</p>
<p class="MsoNormal">                                on: Error</p>
<p class="MsoNormal">                                do: [defaultValueOrBlock value]) ifNil: [defaultValueOrBlock value]</p>
<p class="MsoNormal">Yours removes the unpleasant duplication but as a reader I’d be happy for a comment why do nothing – which is not really “do nothing” but “return nil”.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, Dave’s the author after all so whatever his preference is
<span style="font-family:"Segoe UI Emoji",sans-serif">😊</span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!</p>
<p class="MsoNormal">Jaromir </p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Thiede, Christoph</a><br>
<b>Sent: </b>Thursday, December 16, 2021 23:03<br>
<b>To: </b><a href="mailto:mail@jaromir.net">mail@jaromir.net</a>; <a href="mailto:squeak-dev@lists.squeakfoundation.org">
squeak-dev@lists.squeakfoundation.org</a><br>
<b>Subject: </b>AW: Regression | Cannot interrupt "[ [] repeat ] fork" anymore</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Or even shorter, at a price of being hypothetically a few byte steps more expensive:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">vmParameterAt: parameterIndex ifAbsent: defaultValueOrBlock<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">"Answer a VM parameter or defaultValueOrBlock value if out of range<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">or if the VM does not provide a value for this parameter. A VM parameter<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">is typically numeric or boolean, and if not implemented will be nil."<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">^ ([self vmParameterAt: parameterIndex]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">on: Error do: [])<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">ifNil: [defaultValueOrBlock value]<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Best,<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Christoph<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><img border="0" width="531" height="2" style="width:5.5312in;height:.0208in" id="Horizontal_x0020_Line_x0020_1" src="cid:image001.png@01D7F2D4.870D18D0"><o:p></o:p></p>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">Von:</span></b><span style="color:black"> Thiede, Christoph<br>
<b>Gesendet:</b> Donnerstag, 16. Dezember 2021 22:58:34<br>
<b>An:</b> mail@jaromir.net; squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> AW: Regression | Cannot interrupt "[ [] repeat ] fork" anymore</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<div id="x_divtagdefaultwrapper">
<p><span style="font-size:12.0pt;color:black">Hi Jaromir,<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">oops, you are totally right, sorry, thank you! Hmm ... I still do not like evaluating the defaultValueOrBlock inside the exception handler.<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Would you agree with this version? :-)<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">vmParameterAt: parameterIndex ifAbsent: defaultValueOrBlock<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">"Answer a VM parameter or defaultValueOrBlock value if out of range<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">or if the VM does not provide a value for this parameter. A VM parameter<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">is typically numeric or boolean, and if not implemented will be nil."<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">| result |<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">[result := self vmParameterAt: parameterIndex]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">on: Error<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">do: [^ defaultValueOrBlock value].<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">^ result ifNil: [defaultValueOrBlock value]<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Best,<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Christoph<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><img border="0" width="531" height="2" style="width:5.5312in;height:.0208in" id="Horizontal_x0020_Line_x0020_2" src="cid:image001.png@01D7F2D4.870D18D0"><o:p></o:p></p>
<div id="x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">Von:</span></b><span style="color:black"> mail@jaromir.net <mail@jaromir.net><br>
<b>Gesendet:</b> Donnerstag, 16. Dezember 2021 22:16:28<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; Thiede, Christoph<br>
<b>Betreff:</b> Re: Regression | Cannot interrupt "[ [] repeat ] fork" anymore</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt">Hi Christoph,<br>
<br>
> > I just wanted to suggest<br>
> >                 ^ [(self vmParameterAt: parameterIndex)<br>
> >                                                 ifNil: [defaultValueOrBlock value]]<br>
> >                                 on: Error<br>
> >                                 do: [defaultValueOrBlock value]<br>
>  > <br>
> > i.e. without the return inside ifNil block…<br>
><br>
> The only effective difference would be that if defaultValueOrBlock is a block and raises an error, it would be evaluated a second time.
<br>
><br>
I still don't quite understand: if defaultValueOrBlock is a block and raises an error inside the ifNil block then the error would get handled by the above handler regardless whether there's a return inside the ifNil block or not - or not? :) The return should
 only evaluate after the exception resumes, I think. So actually it seems to me now the return should never get evaluated if defaultValueOrBlock raised an error (unless the error was resumable and resumed).  Or maybe I'm confused :) I'd like to be sure though
 I know how the evaluation goes in such cases, thanks!<br>
<br>
> I cannot make sense of this behavior, can you? :-) Apart from that, the non-local return is a bit slower, I know, but IMHO this should only become an argument if there is no visible change in behavior.<br>
><br>
<br>
Thanks for discussing this.<br>
<br>
Best,<br>
<br>
<br>
~~~<br>
^[^    Jaromir<br>
<br>
Sent from Squeak Inbox Talk<br>
<br>
On 2021-12-16T20:02:34+00:00, christoph.thiede@student.hpi.uni-potsdam.de wrote:<br>
<br>
> Hi Jaromir,<br>
> <br>
> <br>
> > I just wanted to suggest<br>
> >                 ^ [(self vmParameterAt: parameterIndex)<br>
> >                                                 ifNil: [defaultValueOrBlock value]]<br>
> >                                 on: Error<br>
> >                                 do: [defaultValueOrBlock value]<br>
>  ><br>
> > i.e. without the return inside ifNil block…<br>
> <br>
> <br>
> The only effective difference would be that if defaultValueOrBlock is a block and raises an error, it would be evaluated a second time. I cannot make sense of this behavior, can you? :-) Apart from that, the non-local return is a bit slower, I know, but IMHO
 this should only become an argument if there is no visible change in behavior.<br>
> <br>
> <br>
> > So the default processPreemptionYields value remains false, right?<br>
> <br>
> Apparently - without having studied the details of how preemption works in Squeak. :-)<br>
> <br>
> Best,<br>
> Christoph<br>
> <br>
> ________________________________<br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jaromir Matas <mail at jaromir.net><br>
> Gesendet: Donnerstag, 16. Dezember 2021 20:47:27<br>
> An: The general-purpose Squeak developers list<br>
> Betreff: Re: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> Hi Christoph,<br>
> Yes, a good one </span><span style="font-size:10.0pt;font-family:"Segoe UI Emoji",sans-serif">😊</span><span style="font-size:10.0pt"> I just wanted to suggest<br>
>                 ^ [(self vmParameterAt: parameterIndex)<br>
>                                                 ifNil: [defaultValueOrBlock value]]<br>
>                                 on: Error<br>
>                                 do: [defaultValueOrBlock value]<br>
> <br>
> i.e. without the return inside ifNil block…<br>
> <br>
> I noticed recently the image stopped responding to<br>
> Smalltalk processPreemptionYields: false<br>
> <br>
> So the default processPreemptionYields value remains false, right?<br>
> Best,<br>
> Jaromir<br>
> <br>
> From: Thiede, Christoph<mailto:Christoph.Thiede at student.hpi.uni-potsdam.de><br>
> Sent: Thursday, December 16, 2021 20:29<br>
> To: squeak-dev<mailto:squeak-dev at lists.squeakfoundation.org><br>
> Subject: Re: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> <br>
> Ha, got it! This was a small regression in SmalltalkImage >> #processPreemptionYields from dtl 1/5/2021 19:29 (System-dtl.1261). Fixed in System-ct.1268. :-)<br>
> <br>
> <br>
> <br>
> Best,<br>
> <br>
> Christoph<br>
> <br>
> Von: Thiede, Christoph<br>
> Gesendet: Donnerstag, 16. Dezember 2021 19:29:30<br>
> An: squeak-dev<br>
> Betreff: AW: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> <br>
> Hi Dave, hi Marcel,<br>
> <br>
> <br>
> <br>
> one "recent" change I noticed is that one to SmalltalkImage>>#processPreemptionYields by Dave in May, which answered false before but answers true since then. But this is just an observation, I do not know whether this change was justified by a change on
 the VM side.<br>
> <br>
> <br>
> <br>
> > even if CMD+Dot interrupts the "[ [] repeat ] fork" from the interrupt watcher<br>
> <br>
> <br>
> <br>
> How did you achieve to do this? The interrupt doesn't work for me in this situation.<br>
> <br>
> <br>
> <br>
> Best,<br>
> <br>
> Christoph<br>
> <br>
> <br>
> <br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
> Gesendet: Donnerstag, 16. Dezember 2021 15:53:37<br>
> An: squeak-dev<br>
> Betreff: Re: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> Hi Christoph, hi Dave, hi all --<br>
> <br>
> "Processor preemptedProcess" does not behave as it used to be. It now answers the current ui process even if CMD+Dot interrupts the "[ [] repeat ] fork" from the interrupt watcher.<br>
> <br>
> Maybe you can spot the issue right away?<br>
> <br>
> ProcessorScheduler >> preemptedProcess<br>
> "Return the process that the currently active process just preempted."<br>
> self activeProcess priority to: 1 by: -1 do: [:priority |<br>
> (quiescentProcessLists at: priority) ifNotEmpty: [:list |<br>
> ^ Smalltalk processPreemptionYields<br>
> ifTrue: [list last]<br>
> ifFalse: [list first]]].<br>
> ^ nil<br>
> <br>
> Best,<br>
> Marcel<br>
> <br>
> Am 16.12.2021 14:33:51 schrieb David T. Lewis <lewis at mail.msen.com>:<br>
> On Thu, Dec 16, 2021 at 11:27:09AM +0100, Marcel Taeumel wrote:<br>
> > Hi all --<br>
> ><br>
> > I am investigating a?? regression revealed via DebuggerTests >> test01UserInterrupt. One cannot interrupt "[ [] repeat ] fork" from a do-it anymore. :-(<br>
> ><br>
> > VM: 202112022203 (32-bit, Windows 10)<br>
> ><br>
> > Update: #20872<br>
> ><br>
> > Since the forked process should run at priority 40 and the "user interrupt watcher" watches at priority 60, this must work. Did we loose a process scheduling point in "[] repeat"? It's still implemented as "[self value. true] whileTrue".<br>
> ><br>
> <br>
> Confirming on Linux and also on an interpreter VM with trunk level V3 image,<br>
> so the issue is in the image, not the VM.<br>
> <br>
> Dave<br>
> <br>
> <br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <</span><a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.html"><span style="font-size:10.0pt">http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.html</span></a><span style="font-size:10.0pt">><br>
> -------------- next part --------------<br>
> A non-text attachment was scrubbed...<br>
> Name: 0CB9301048554EEBA662C4875E74FF8A.png<br>
> Type: image/png<br>
> Size: 141 bytes<br>
> Desc: 0CB9301048554EEBA662C4875E74FF8A.png<br>
> URL: <</span><a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.png"><span style="font-size:10.0pt">http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.png</span></a><span style="font-size:10.0pt">><br>
> <br>
> <o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>