<div dir="ltr">It is already done! Thanks to Hilaire<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 3 Dec 2023 at 14:37, Luciano Notarfrancesco <<a href="mailto:luchiano@gmail.com">luchiano@gmail.com</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 dir="auto">I think we removed those messages from String a few years ago. Someone should fix the exercise…</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 3, 2023 at 21:17 Ezequiel Birman via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</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 dir="ltr">To answer myself, the fact that we can evaluate `'' raisedTo: n` without error seems like an unforeseen consequence of `#adaptToCollection:andSend:` relying on `#collect` and how the latter works with empty collections.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 1 Dec 2023 at 21:56, Ezequiel Birman <<a href="mailto:ebirman77@gmail.com" target="_blank">ebirman77@gmail.com</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 dir="ltr"><div dir="ltr">The exercise is:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">How many methods are there in the arithmetic method category of the String class?<br></blockquote><div><br></div><div>There are no messages categorized as arithmetic in String but in CharacterSequence, which String subclassifies. Maybe it was different before; Squeak Strings implement arithmetic messages, exactly those mentioned in the solution to the exercise:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">the count of methods in the last right panel is 6: *, +, -, /, // and \\.<br></blockquote><div>But `String allMethodsInCategory: 'arithmetic'` in both Cuis and Squeak evaluates as:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> #(#* #+ #- #/ #// #\\ #raisedTo:)<br></blockquote><div>Seven methods and yes! you can raise the empty string to the power of n for n ∈ Number. WAT! The result is another empty string :) Are we able to do this because of historical reasons? Strings in Squeak can be added E.g `'3' + '4'` is the string '7'.<br></div><div><br></div><div>Btw, I'm sharing <a href="https://hyp.is/k4BuJpCLEe6_Z59nfniWQQ/cuis-smalltalk.github.io/TheCuisBook/A-brief-introduction-to-the-system-Browser.html" target="_blank">my annotations</a> via <a href="http://hypothes.is" target="_blank">hypothes.is</a> publicly but you'll need to install the Chrome plugin or the <a href="https://github.com/diegodlh/unofficial-hypothesis-extension" target="_blank">unofficial Firefox extension</a> to see them. I've requested to use their proxy so you don't have to, but it might take some time. Once you install any of the plugins you'll be able to read and write comments. The UI looks like this:<br><img src="cid:ii_lpn5n9tv0" alt="imagen.png" style="width: 1180px; max-width: 100%;"><br><br></div></div></div></div></div>
</blockquote></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div></div>
</blockquote></div>