<html 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)">
<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:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
/* 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;}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
{mso-style-priority:1;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.m-1600922189656175313msonospacing, li.m-1600922189656175313msonospacing, div.m-1600922189656175313msonospacing
{mso-style-name:m_-1600922189656175313msonospacing;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.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">
<div class="WordSection1">
<p class="MsoNormal">> Perhaps, rephrase "<span style="color:#500050">Semicolons can be used to send a cascade of messages to the original receiver</span>" to "<span style="color:#500050">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?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">"sender" has a distinct meaning; it's a context that initiated sending of a message but this can't be used here.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I would revert the wording to the original wording in Squeak by Example (aka SBE, see page 52 of Edition 5.3):</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">"Semicolons can be used to send a cascade of messages to a single receiver. [...]"</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Or, possibly, include a more explicit explanation (also from the SBE):</p>
<p class="MsoNormal">Smalltalk offers a way to send multiple messages to the same receiver using a semicolon (;). This is called the cascade in Smalltalk jargon. The receiver is specified just once, and the sequence of messages is separated by semi-colons.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Double-colon is not, strictly speaking, "cascading" but rather chaining messages (or we can just accept an extended meaning of "cascade").</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks to the precedence rules we can chain unary messages without any further syntactic means:</p>
<p class="MsoNormal">#(1 2 3) squared max negated</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In order to be able to do the same with keyword messages the double-colon has been added to the compiler:</p>
<p class="MsoNormal">#(1 2 3) raisedTo: 2 :: max: [:x|x] :: negated</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNoSpacing"><span lang="CS">--</span></p>
<p class="MsoNoSpacing"><strong><span style="font-family:"Calibri Light",sans-serif;color:#333333;font-weight:normal">Jaromír Matas</span></strong><span style="font-family:"Calibri Light",sans-serif;color:#555555"><br>
</span><span style="font-family:"Calibri Light",sans-serif;color:#2E75B6">mail@jaromir.net</span><span style="font-family:"Calibri Light",sans-serif;color:#555555"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#8FAADC"><o:p> </o:p></span></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:yalexr@gmail.com">Alexandre Rousseau</a><br>
<b>Sent: </b>Friday, March 10, 2023 17:18<br>
<b>To: </b><a href="mailto:cuis-dev@lists.cuis.st">Discussion of Cuis Smalltalk</a><br>
<b>Cc: </b><a href="mailto:mail@jaromir.net">Jaromir Matas</a>; <a href="mailto:jhylands@gmail.com">
jhylands@gmail.com</a><br>
<b>Subject: </b>Re: [Cuis-dev] What is the meaning of "::" in code examples ?</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">It's a nice nuance.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">#(1 2 3) negated select: #odd; collect: #cubed. #(-1 -8 -27)<br>
#(1 2 3) negated; select: #odd; collect: #cubed. #(1 8 27)<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Perhaps, rephrase "<span style="color:#500050">Semicolons can be used to send a cascade of messages to the original receiver</span>" to "<span style="color:#500050">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?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, Mar 10, 2023 at 10:23 AM Jaromir Matas <<a href="mailto:mail@jaromir.net">mail@jaromir.net</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Alexandre, Jon,</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">> Semicolons can be used to send a cascade of messages to the original receiver.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Note it’s not immediately clear what the “original receiver” is (at least to me); check this:</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#(1 2 3) negated select: #odd; collect: #cubed "---> #(-1 -8 -27)"</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The “original receiver” is the result of `#(1 2 3) negated` and not `#(1 2 3)` as one might think.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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:</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">BoxedMorph new color: Color blue; openInWorld.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">> It is sometimes useful to send messages to the result of a message send.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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:</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#(1 2 3) negated select: #odd :: collect: #cubed "---> #(-1 -27)"</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I think a more relevant BoxedMorph example would be (whether meaningful or not):</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">BoxedMorph newFrom: BoxedMorph new :: color: Color blue; openInWorld.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">This wouldn’t work without the double colon.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Best,</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Jaromir</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="m-1600922189656175313msonospacing"><span lang="CS">--</span></p>
<p class="m-1600922189656175313msonospacing"><strong><span style="font-family:"Calibri Light",sans-serif;color:#333333;font-weight:normal">Jaromír Matas</span></strong><span style="font-family:"Calibri Light",sans-serif;color:#555555"><br>
</span><span style="font-family:"Calibri Light",sans-serif;color:#2E75B6"><a href="mailto:mail@jaromir.net" target="_blank">mail@jaromir.net</a></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#8FAADC"> </span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> Thanks for the link.</p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
* Cascades<br>
There are two kinds of message cascades.</p>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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.</p>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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.</p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">So,</p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .</p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">can also be expressed as</p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
lay1 beRow; borderWidth: 1; borderColor: (Color black).</p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">since all messages are intended for the original receiver (lay1).</p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">And since "beRow" also returns the original object (lay1),</p>
</div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .</p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">works as well.</p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">A.</p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">> 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</p>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>