Skip to content

Commit

Permalink
Clarification on cascade and serie of messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hilaire committed Aug 12, 2024
1 parent b149c90 commit f5d11df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/Indexes.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ <h2 class="appendix" id="Conceptual-index"><span>Appendix H Conceptual index<a c
<tr><td></td><td class="printindex-index-entry"><a href="Fun-with-collections.html#index-Caesar-cipher">Caesar cipher</a></td><td class="printindex-index-section"><a href="Fun-with-collections.html">Fun with collections</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="Message-send-definitions.html#index-cascade-of-messages">cascade of messages</a></td><td class="printindex-index-section"><a href="Message-send-definitions.html">Message send definitions</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="Summary-of-Syntax.html#index-cascade-of-messages-1">cascade of messages</a></td><td class="printindex-index-section"><a href="Summary-of-Syntax.html">Summary of Syntax</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="Summary-of-Syntax.html#index-chain-of-messages">chain of messages</a></td><td class="printindex-index-section"><a href="Summary-of-Syntax.html">Summary of Syntax</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="The-Change-Log.html#index-change-log">change log</a></td><td class="printindex-index-section"><a href="The-Change-Log.html">The Change Log</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="The-Change-Set.html#index-change-set">change set</a></td><td class="printindex-index-section"><a href="The-Change-Set.html">The Change Set</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="Kernel_002dText.html#index-character">character</a></td><td class="printindex-index-section"><a href="Kernel_002dText.html">Kernel-Text</a></td></tr>
Expand Down
13 changes: 8 additions & 5 deletions docs/Summary-of-Syntax.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h2 class="appendix" id="Summary-of-Syntax-1"><span>Appendix B Summary of Syntax
<tr><td width="49%"><code class="code">&#x2191; true</code>, <code class="code">^ true</code></td><td width="1%"></td><td width="50%">return the value true</td></tr>
<tr><td width="49%"><code class="code">Transcript show: 'hello'. Transcript cr</code></td><td width="1%"></td><td width="50%">expression separator (.)</td></tr>
<tr><td width="49%"><code class="code">Transcript show: 'hello'; cr</code></td><td width="1%"></td><td width="50%">message cascade (;)</td></tr>
<tr><td width="49%"><code class="code">BoxedMorph new :: color: Color blue; openInWorld</code></td><td width="1%"></td><td width="50%">message cascade (::)</td></tr>
<tr><td width="49%"><code class="code">BoxedMorph new :: color: Color blue; openInWorld</code></td><td width="1%"></td><td width="50%">message chain (::)</td></tr>
<tr><td width="49%"><code class="code">`{ 3@4 . 56 . 'click me'}`</code></td><td width="1%"></td><td width="50%">the compound literal <code class="code">#(3@4 56 'click me')</code></td></tr>
</tbody>
</table>
Expand Down Expand Up @@ -311,21 +311,24 @@ <h2 class="appendix" id="Summary-of-Syntax-1"><span>Appendix B Summary of Syntax
<a class="index-entry-id" id="index-cascade-of-messages-1"></a>
</dd>
<dt><strong class="strong">Cascades.</strong></dt>
<dd><a class="index-entry-id" id="index-chain-of-messages"></a>
</dd>
<dt><strong class="strong">Chains.</strong></dt>
<dd>
<p>There are two kinds of message cascades.
<p>There are two kinds of message compositions, cascade and chain.
</p>
<p>Semicolons can be used to send a cascade of messages to the original
<p>Semicolons can be used to send a series of messages to the original
receiver. In <code class="code">Transcript show: 'hello'; cr</code> we first send
the keyword message <code class="code">#show: 'hello'</code> to the receiver
<code class="code">Transcript</code>, and then we send the unary message <code class="code">#cr</code> to
the same receiver.
</p>
<p>It is sometimes useful to send messages to the <em class="emph">result</em> of a message send.
<p>It is sometimes useful to send a series of messages to the <em class="emph">result</em> of a message send.
In <code class="code"> BoxedMorph new :: color: Color blue; openInWorld. </code> we send
suceeding messages to the new BoxedMorph instance, not the BoxedMorph
class.
</p>
<p>To better understand the differences between these message cascades,
<p>To better understand the differences between message cascade and chain,
observe the result of the three statements below:
</p>
<div class="example smallexample">
Expand Down
12 changes: 7 additions & 5 deletions en/syntaxSummary.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@item @smalltalk{@U{2191} true}, @smalltalk{^ true} @tab @tab return the value true
@item @smalltalk{Transcript show: 'hello'. Transcript cr} @tab @tab expression separator (.)
@item @smalltalk{Transcript show: 'hello'; cr} @tab @tab message cascade (;)
@item @smalltalk{BoxedMorph new :: color: Color blue; openInWorld} @tab @tab message cascade (::)
@item @smalltalk{BoxedMorph new :: color: Color blue; openInWorld} @tab @tab message chain (::)
@item @smalltalk{`@{ 3@@4 . 56 . 'click me'@}`} @tab @tab the compound literal @smalltalk{#(3@@4 56 'click me')}
@end multitable
@end float
Expand Down Expand Up @@ -205,21 +205,23 @@

@cindex cascade of messages
@item Cascades.
@cindex chain of messages
@item Chains.

There are two kinds of message cascades.
There are two kinds of message compositions, cascade and chain.

Semicolons can be used to send a cascade of messages to the original
Semicolons can be used to send a series of messages to the original
receiver. In @smalltalk{Transcript show: 'hello'; cr} we first send
the keyword message @msg{show: 'hello'} to the receiver
@class{Transcript}, and then we send the unary message @msg{cr} to
the same receiver.

It is sometimes useful to send messages to the @emph{result} of a message send.
It is sometimes useful to send a series of messages to the @emph{result} of a message send.
In @smalltalk{ BoxedMorph new :: color: Color blue; openInWorld. } we send
suceeding messages to the new BoxedMorph instance, not the BoxedMorph
class.

To better understand the differences between these message cascades,
To better understand the differences between message cascade and chain,
observe the result of the three statements below:

@smallexample
Expand Down

0 comments on commit f5d11df

Please sign in to comment.