<div dir="ltr">It's a nice nuance.<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">#(1 2 3) negated select: #odd; collect: #cubed. #(-1 -8 -27)<br> #(1 2 3) negated; select: #odd; collect: #cubed. #(1 8 27)</blockquote><div><br></div><div>Perhaps, rephrase "<span style="color:rgb(80,0,80)">Semicolons can be used to send a cascade of messages to the original receiver</span>" to "<span style="color:rgb(80,0,80)">Semicolons can be used to send a cascade of messages to the closest sender</span>"? This may be truer but the term "closest sender" is confusing; closest to what?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 10, 2023 at 10:23 AM Jaromir Matas <<a href="mailto:mail@jaromir.net">mail@jaromir.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-3544234574936281016">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_-1600922189656175313WordSection1">
<p class="MsoNormal">Hi Alexandre, Jon,</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">> Semicolons can be used to send a cascade of messages to the original receiver.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Note it’s not immediately clear what the “original receiver” is (at least to me); check this:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">#(1 2 3) negated select: #odd; collect: #cubed "---> #(-1 -8 -27)"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The “original receiver” is the result of `#(1 2 3) negated` and not `#(1 2 3)` as one might think.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In light of this the quoted example `BoxedMorph new :: color: Color blue; openInWorld.` is misleading, imo, because it suggests the double colon is relevant here but it’s not: this gives the same result:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">BoxedMorph new color: Color blue; openInWorld.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">> It is sometimes useful to send messages to the result of a message send.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Each message is sent to the result of the previous message send by default (taking precedence into account indeed). The double colon effectively separates the keyword messages so that they act similarly like unary messages when chained:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">#(1 2 3) negated select: #odd :: collect: #cubed "---> #(-1 -27)"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I think a more relevant BoxedMorph example would be (whether meaningful or not):</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">BoxedMorph newFrom: BoxedMorph new :: color: Color blue; openInWorld.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This wouldn’t work without the double colon.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Best,</p>
<p class="MsoNormal">Jaromir</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="m_-1600922189656175313MsoNoSpacing"><span lang="CS">--</span><u></u><u></u></p>
<p class="m_-1600922189656175313MsoNoSpacing"><strong><span style="font-family:"Calibri Light",sans-serif;color:rgb(51,51,51);font-weight:normal">Jaromír Matas</span></strong><span style="font-family:"Calibri Light",sans-serif;color:rgb(85,85,85)"><br>
</span><span style="font-family:"Calibri Light",sans-serif;color:rgb(46,117,182)"><a href="mailto:mail@jaromir.net" target="_blank">mail@jaromir.net</a></span><span style="font-family:"Calibri Light",sans-serif;color:rgb(85,85,85)"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(143,170,220)"><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:cuis-dev@lists.cuis.st" target="_blank">Alexandre Rousseau via Cuis-dev</a><br>
<b>Sent: </b>Friday, March 10, 2023 7:52<br>
<b>To: </b><a href="mailto:cuis-dev@lists.cuis.st" target="_blank">Discussion of Cuis Smalltalk</a><br>
<b>Cc: </b><a href="mailto:yalexr@gmail.com" target="_blank">Alexandre Rousseau</a>; <a href="mailto:jhylands@gmail.com" target="_blank">
jhylands@gmail.com</a><br>
<b>Subject: </b>Re: [Cuis-dev] What is the meaning of "::" in code examples ?</p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"> Thanks for the link.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:9.6pt">* Cascades<br>
There are two kinds of message cascades.<u></u><u></u></p>
</blockquote>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:9.6pt"><br>
Semicolons can be used to send a cascade of messages to the original<br>
receiver. In "Transcript show: 'hello'; cr" we first send the keyword<br>
message #show: 'hello' to the receiver Transcript, and then we send<br>
the unary message #cr to the same receiver.<u></u><u></u></p>
</blockquote>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:9.6pt"><br>
It is sometimes useful to send messages to the result of a message<br>
send. In "BoxedMorph new :: color: Color blue; openInWorld.", we send<br>
succeeding messages to the new BoxedMorph instance, not the BoxedMorph<br>
class.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">So,<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:9.6pt">lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">can also be expressed as<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:9.6pt">lay1 beRow; borderWidth: 1; borderColor: (Color black).<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal">since all messages are intended for the original receiver (lay1).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">And since "beRow" also returns the original object (lay1),<u></u><u></u></p>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:9.6pt">lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal">works as well.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">A.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">> According to this page:<br>
> <br>
> <a href="https://cuis-smalltalk.github.io/TheCuisBook/Summary-of-Syntax.html" target="_blank">https://cuis-smalltalk.github.io/TheCuisBook/Summary-of-Syntax.html</a><br>
> <br>
> Double-colon sends the message to the result of the previous expression. I<br>
> would guess that would make it functionally equivalent to putting the<br>
> previous expression in parens.<br>
> <br>
> So:<br>
> <br>
> lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .<br>
> <br>
> would be the same as:<br>
> <br>
> ((lay1 beRow) borderWidth: 1) borderColor: (Color black) .<br>
> <br>
> Unless I'm missing something...<br>
> <br>
> - Jon<u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></blockquote></div>