<div dir="ltr"><div dir="ltr">See my replies inline below with some parts snipped to focus my replies.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 5, 2024 at 12:19 PM Andres Valloud via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:</div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Always be on the lookout for when a receiver is just self.  Otherwise, <br>
the code is not using the knowledge it has of where it is implemented <br>
(and this leads to all sorts of problems later).<br></blockquote><div><br></div><div>Ah! I did not know that I could use `self` to refer to the class in a class method.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Also, you can accomplish the same with much less code.  Any time you <br>
have a class whose class methods offer a "service" but do not really <br>
have instances, you should suspect the code should be placed elsewhere.<br></blockquote><div><br></div><div>I see that I don't need the <font face="monospace">next:</font> method and can just move that code in the <font face="monospace">gather:seq:</font> method.</div><div>But it's not apparent to me what else I can do to make the code shorter.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Side comment: I've been working on the Collatz problem for a *long* <br>
time, so I have quite a few opinions on how to go about writing <br>
specifically this code...<br></blockquote><div><br></div><div>I know I could add caching of results to make subsequent calls with different integers much faster.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">But in this particular case, what you're collecting is the orbit of an <br>
integer (so, anInteger, not aNumber).</blockquote><div><br></div><div>Excellent point! I changed every occurrence of `aNumber` to `anInteger` in my code.</div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>