<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 1:51 AM, Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I realise that we never have "immutable with a capital I", hence why I<br>
used the term "purely functional" to try work around the ambiguity<br>
[1]. But the point is that Chris thinks that all Numbers behave like<br>
SmallInteger, Boolean and Point in that they are, indeed, "immutable<br>
by convention". It sounded to me like Levente was saying that this was<br>
not true. If there are Numbers that are not "immutable by convention"<br>
we should _make_ them immutable by convention ASAP!<br></blockquote><div><br></div><div>Agreed. But note that there are edge cases in this apparently straight-forward case. The LargeIntegers need to be mutable while they're being constructed (they're not all constructed by primitive code and that primitive code is optional). </div>
<div><br></div><div>But on the "we will never have immutable with a capital I" point I disagree. The VM can easily enforce immutability. I actually implemented this for the Newspeak interpreter VM in 2007. It is a "small matter" of implementation to move it into Cog. It's probably two weeks work. But its not a priority yet. It might be a good thing to introduce when we move to Spur because there will be other things that will disturb too (image segments, ephemerons to be used, etc).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
frank<br>
<br>
[1] "Immutable with a capital I" requires VM support, IIRC<br>
<br>
On 26 November 2013 22:45, Nicolas Cellier<br>
<<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> What Levente says is that this immutability is purely conventional and not<br>
> guaranteed.<br>
> Numbers are technically mutable (but SmallInteger).<br>
> Though, I strongly suggest to not play with such mutations, a mutant Number<br>
> would be a frightening thing mathematically speaking...<br>
><br>
><br>
> 2013/11/26 Frank Shearar <<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>><br>
>><br>
>> On 26 November 2013 18:02, Levente Uzonyi <<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>> wrote:<br>
>> > On Tue, 26 Nov 2013, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
>> ><br>
>> >> Chris Muller uploaded a new version of Kernel to project The Trunk:<br>
>> >> <a href="http://source.squeak.org/trunk/Kernel-cmm.821.mcz" target="_blank">http://source.squeak.org/trunk/Kernel-cmm.821.mcz</a><br>
>> >><br>
>> >> ==================== Summary ====================<br>
>> >><br>
>> >> Name: Kernel-cmm.821<br>
>> >> Author: cmm<br>
>> >> Time: 26 November 2013, 10:24:26.281 am<br>
>> >> UUID: 591c1ede-81bc-40d7-8591-af7fe29b2bd5<br>
>> >> Ancestors: Kernel-fbs.820<br>
>> >><br>
>> >> - Don't let Boolean and Number inherit Object's really slow<br>
>> >> #veryDeepCopy.<br>
>> ><br>
>> ><br>
>> > Some Numbers are mutable objects, so this doesn't sound right.<br>
>><br>
>> Which Numbers are mutable? They _should_ all be purely functional,<br>
>> like Point (which I know is not a Number).<br>
>><br>
>> frank<br>
>><br>
>> > Levente<br>
>> ><br>
>> ><br>
>> >><br>
>> >> =============== Diff against Kernel-fbs.820 ===============<br>
>> >><br>
>> >> Item was added:<br>
>> >> + ----- Method: Boolean>>veryDeepCopy (in category 'copying') -----<br>
>> >> + veryDeepCopy<br>
>> >> + "Overridden for performance to avoid #fixDependents."<br>
>> >> + ^ self!<br>
>> >><br>
>> >> Item was added:<br>
>> >> + ----- Method: Number>>veryDeepCopy (in category 'private') -----<br>
>> >> + veryDeepCopy<br>
>> >> + "Overridden for performance."<br>
>> >> + ^ self!<br>
>> >><br>
>> >><br>
>> >><br>
>> ><br>
>><br>
><br>
><br>
><br>
><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>