<div dir="ltr"><div><div>Yes, please, don&#39;t argue, I was pulling your leg ;)<br></div>What I generally say is that Smalltalk is the most functional object oriented language (intentionally ignoring Scala)<br></div>However optimization would require knowledge of state mutation (or absence of) and I don&#39;t see anything easy on that front...<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/28 Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don&#39;t really have the energy for re-arguing that point. In summary,<br>
the primary argument against Smalltalk being an FPL is that the<br>
community doesn&#39;t write functional code. Inefficient? Only because<br>
noone&#39;s bothered making it efficient.<br>
<br>
So I&#39;m not going to argue any further, and instead continue pushing<br>
Squeak in the direction of writing code functionally.<br>
<br>
(Note that nothing in that SO argument even vaguely touches the actual<br>
serious stuff, like &quot;classes confound several issues that should be<br>
orthogonal&quot;.)<br>
<br>
frank<br>
<br>
On 28 April 2013 01:13, Nicolas Cellier<br>
<div class="HOEnZb"><div class="h5">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt; Ah, yes, in a FPL it&#39;s another story...<br>
&gt; By the way Frank, sorry for<br>
&gt; <a href="http://stackoverflow.com/questions/3527753/why-is-smalltalk-not-a-functional-programming-language" target="_blank">http://stackoverflow.com/questions/3527753/why-is-smalltalk-not-a-functional-programming-language</a>,<br>

&gt; Smalltalk if ever considered as a FPL, would not only be an impure FPL but<br>
&gt; also an inefficient one :(<br>
&gt;<br>
&gt;<br>
&gt; 2013/4/27 Levente Uzonyi &lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Sat, 27 Apr 2013, Frank Shearar wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; In Schlemiel&#39;s algorithm you have to traverse your string from the<br>
&gt;&gt;&gt; beginning. Here, the problem is that at every step you&#39;re making<br>
&gt;&gt;&gt; String after String after String that you just throw away.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Unless perhaps you&#39;re suggesting that the Schlemielness comes from not<br>
&gt;&gt;&gt; doing things the way our particular garbage collector like to do<br>
&gt;&gt;&gt; things?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Your code looks right, and works well in a functional programming language<br>
&gt;&gt; which has the required optimizations to run such code efficiently. But in<br>
&gt;&gt; Smalltalk it creates 2n-1 intermediate strings, where the previous is the<br>
&gt;&gt; prefix of the current one, so each one is longer than the previous, which<br>
&gt;&gt; means that O(n^2) bytes are allocated, filled, read once, and then garbage<br>
&gt;&gt; collected. This means that the runtime cost is also O(n^2).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Levente<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; frank<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 27 April 2013 22:08, Nicolas Cellier<br>
&gt;&gt;&gt; &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; <a href="http://en.wikipedia.org/wiki/Schlemiel_the_Painter%27s_algorithm" target="_blank">http://en.wikipedia.org/wiki/Schlemiel_the_Painter%27s_algorithm</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 2013/4/27 &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Levente Uzonyi uploaded a new version of Tests to project The Trunk:<br>
&gt;&gt;&gt;&gt;&gt; <a href="http://source.squeak.org/trunk/Tests-ul.200.mcz" target="_blank">http://source.squeak.org/trunk/Tests-ul.200.mcz</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Name: Tests-ul.200<br>
&gt;&gt;&gt;&gt;&gt; Author: ul<br>
&gt;&gt;&gt;&gt;&gt; Time: 27 April 2013, 10:08:43.206 pm<br>
&gt;&gt;&gt;&gt;&gt; UUID: dfe70287-0768-42f9-97b7-d7ba6fbd6bb6<br>
&gt;&gt;&gt;&gt;&gt; Ancestors: Tests-fbs.199<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; - avoid suboptimal string concatentation in ReleaseTest &gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; #testMethodsWithUnboundGlobals<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; =============== Diff against Tests-fbs.199 ===============<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Item was changed:<br>
&gt;&gt;&gt;&gt;&gt;   ----- Method: ReleaseTest&gt;&gt;testMethodsWithUnboundGlobals (in category<br>
&gt;&gt;&gt;&gt;&gt; &#39;testing&#39;) -----<br>
&gt;&gt;&gt;&gt;&gt;   testMethodsWithUnboundGlobals<br>
&gt;&gt;&gt;&gt;&gt;         | unbound |<br>
&gt;&gt;&gt;&gt;&gt;         unbound := SystemNavigation default methodsWithUnboundGlobals.<br>
&gt;&gt;&gt;&gt;&gt;         Smalltalk cleanOutUndeclared.<br>
&gt;&gt;&gt;&gt;&gt; +       self assert: unbound isEmpty description: &#39;Unbound: &#39;, unbound<br>
&gt;&gt;&gt;&gt;&gt; asCommaString!<br>
&gt;&gt;&gt;&gt;&gt; -       self assert: unbound isEmpty description: (&#39;Unbound: &#39;,<br>
&gt;&gt;&gt;&gt;&gt; (unbound<br>
&gt;&gt;&gt;&gt;&gt; reduce: [:acc :each | acc, &#39;, &#39;, each]))!<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>