<div dir="ltr"><div><div>Yes, please, don'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'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"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don'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't write functional code. Inefficient? Only because<br>
noone's bothered making it efficient.<br>
<br>
So I'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 "classes confound several issues that should be<br>
orthogonal".)<br>
<br>
frank<br>
<br>
On 28 April 2013 01:13, Nicolas Cellier<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> Ah, yes, in a FPL it's another story...<br>
> By the way Frank, sorry for<br>
> <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>
> Smalltalk if ever considered as a FPL, would not only be an impure FPL but<br>
> also an inefficient one :(<br>
><br>
><br>
> 2013/4/27 Levente Uzonyi <<a href="mailto:leves@elte.hu">leves@elte.hu</a>><br>
>><br>
>> On Sat, 27 Apr 2013, Frank Shearar wrote:<br>
>><br>
>>> In Schlemiel's algorithm you have to traverse your string from the<br>
>>> beginning. Here, the problem is that at every step you're making<br>
>>> String after String after String that you just throw away.<br>
>>><br>
>>> Unless perhaps you're suggesting that the Schlemielness comes from not<br>
>>> doing things the way our particular garbage collector like to do<br>
>>> things?<br>
>><br>
>><br>
>> Your code looks right, and works well in a functional programming language<br>
>> which has the required optimizations to run such code efficiently. But in<br>
>> Smalltalk it creates 2n-1 intermediate strings, where the previous is the<br>
>> prefix of the current one, so each one is longer than the previous, which<br>
>> means that O(n^2) bytes are allocated, filled, read once, and then garbage<br>
>> collected. This means that the runtime cost is also O(n^2).<br>
>><br>
>><br>
>> Levente<br>
>><br>
>><br>
>>><br>
>>> frank<br>
>>><br>
>>> On 27 April 2013 22:08, Nicolas Cellier<br>
>>> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
>>>><br>
>>>> <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>
>>>><br>
>>>><br>
>>>> 2013/4/27 <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>><br>
>>>><br>
>>>>> Levente Uzonyi uploaded a new version of Tests to project The Trunk:<br>
>>>>> <a href="http://source.squeak.org/trunk/Tests-ul.200.mcz" target="_blank">http://source.squeak.org/trunk/Tests-ul.200.mcz</a><br>
>>>>><br>
>>>>> ==================== Summary ====================<br>
>>>>><br>
>>>>> Name: Tests-ul.200<br>
>>>>> Author: ul<br>
>>>>> Time: 27 April 2013, 10:08:43.206 pm<br>
>>>>> UUID: dfe70287-0768-42f9-97b7-d7ba6fbd6bb6<br>
>>>>> Ancestors: Tests-fbs.199<br>
>>>>><br>
>>>>> - avoid suboptimal string concatentation in ReleaseTest >><br>
>>>>> #testMethodsWithUnboundGlobals<br>
>>>>><br>
>>>>> =============== Diff against Tests-fbs.199 ===============<br>
>>>>><br>
>>>>> Item was changed:<br>
>>>>> ----- Method: ReleaseTest>>testMethodsWithUnboundGlobals (in category<br>
>>>>> 'testing') -----<br>
>>>>> testMethodsWithUnboundGlobals<br>
>>>>> | unbound |<br>
>>>>> unbound := SystemNavigation default methodsWithUnboundGlobals.<br>
>>>>> Smalltalk cleanOutUndeclared.<br>
>>>>> + self assert: unbound isEmpty description: 'Unbound: ', unbound<br>
>>>>> asCommaString!<br>
>>>>> - self assert: unbound isEmpty description: ('Unbound: ',<br>
>>>>> (unbound<br>
>>>>> reduce: [:acc :each | acc, ', ', each]))!<br>
>>>>><br>
>>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>><br>
>>><br>
>><br>
><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>