<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 27, 2012 at 1:04 PM, Joseph J Alotta <span dir="ltr">&lt;<a href="mailto:joseph.alotta@gmail.com" target="_blank">joseph.alotta@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1. If a message does not return self, then you wouldn&#39;t be able to chain messages<br>
together or to cascade messages.<br>
<br>
for example:<br>
<br>
|s|<br>
<br>
s := Sphere new.<br>
<br>
s rotateLeft; rotateRight; spin 60.<br>
<br>
would have to be:<br>
<br>
s rotateLeft.<br>
s rotateRight.<br>
s spin 60.<br></blockquote><div><br></div><div style>Cascading using semicolons would still work if methods didn&#39;t answer self, but would be less useful in some circumstances.</div><div style><br></div><div style>The cascade rule is that subsequent messages get sent to the same receiver as the most recent one, so in</div>
<div style><br></div><div style>  s</div><div style>    rotateLeft;</div><div style>    rotateRight;</div><div style>    spin: 60</div><div style><br></div><div style>all of the messages get sent to s - no matter what they return.</div>
<div style><br></div><div style>But here&#39;s where it&#39;s useful for simple modifier messages like these to answer self: say we had</div><div style><br></div><div style>  s := Sphere new</div><div style>    rotateLeft;</div>
<div style>    rotateRight;</div><div style>    spin: 60.</div><div style><br></div><div style>Here the last three messages get sent to the result of (Sphere new). The result of the the entire cascade is the result of the last message sent, spin:. Since spin: answers self, we can do the Sphere creation and setup all in one cascade. Otherwise we&#39;d have to split it:</div>
<div style><br></div><div style>  &quot;If spin: didn&#39;t answer self&quot;</div><div style>  s := Sphere new.</div><div style>  s</div><div style>    rotateLeft;</div><div style>    rotateRight;</div><div style>    spin: 60.</div>
<div style><br></div><div style>Ben<br></div><div style><br></div></div></div></div>