<div dir="ltr">Sorry, this was for public discussion, I often forget to check reply all...<br><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>De : <b class="gmail_sendername" dir="auto">Nicolas Cellier</b> <span dir="auto"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>></span><br>Date: sam. 9 mai 2020 à 11:36<br>Subject: Re: [Cuis-dev] Language constructs<br>To: Juan Vuletich <<a href="mailto:juan@jvuletich.org">juan@jvuletich.org</a>><br></div><br><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 6 mai 2020 à 16:22, Juan Vuletich <<a href="mailto:juan@jvuletich.org" target="_blank">juan@jvuletich.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/1/2020 12:53 PM, Nicolas Cellier via Cuis-dev wrote:<br>
> For myself, I find the { } syntax very short and useful. I use it a <br>
> lot even if it reduces a bit portability.<br>
> Also note that the construct is supported by dedicated byteCodes.<br>
><br>
> I like the Float64Array extension #[ 1.0 3.5 ], maybe it should be <br>
> generalized in Squeak/Pharo.<br>
<br>
Yes!<br>
<br>
> But we should also optimize the class with same set as primitives as <br>
> FloatArray, which is IMO even more useful.<br>
<br>
I agree that having the FloatArrays primitives would be great. <br>
Especially #floatAt: and #floatAt:put:, the simplest ones.<br>
<br>
> Note the alternative to backticks that can be used in Squeak: ^[ 0@0 ] <br>
> once.<br>
> It does not require a new syntax, just an elegant trick.<br>
> But it costs 3 message send and 2 Dictionary lookup at runtime though...<br>
> With pre-existing Dolphin ##( 0@0 ) we now have at least 2 syntaxes <br>
> and 3 ways to achieve the same effect in Smalltalk, which is not ideal...<br>
><br>
> I would vote for immutability of all literals including backticks. <br>
> That's the least surprising.<br>
> Otherwise, if you mutate the literal, then the code shows a non <br>
> corresponding value, which is misleading.<br>
<br>
I completely agree. Do you know what is the status of immutability in <br>
Squeak and Pharo? Wasn't the VM work done by Clement a few years ago?<br>
<br></blockquote><div><br></div><div>Yes, the VM work has been accomplished for some time now.</div><div>Literal immutability supported by VM primitives has been introduced very recently in Squeak trunk (post the 5.3 release).</div><div>We had relatively few hickups with the existing code base, so good news, Squeak mostly do not depend on literal mutability, I would be amazed if it were different in Cuis - I expect cleaner, or at least much more controlled code in Cuis :)</div><div><br></div><div>See #setIsReadOnlyObject: (primitive 164) and senders (there are few, mostly Encoder>>#setReadOnlyIfAppropriate:).</div><div>Concerning Pharo, I did not check for a while.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> The first time I was bitten with this was in st80 in the late eighties...<br>
> I discovered that I could write (WriteStream on: 'some literal') which <br>
> was much shorter than (WriteStream on String new; nextPutAll: 'same <br>
> literal'; yourself).<br>
> But WriteStream did use a become: under the hood when writing past the <br>
> destination size, and as a newbie, it tooks me some time to understand <br>
> why my nicer code would not give the expected result twice :)<br>
><br>
<br>
Yes... Immutable literals would be great.<br>
<br>
Thanks,<br>
<br>
-- <br>
Juan Vuletich<br>
<a href="http://www.cuis-smalltalk.org" rel="noreferrer" target="_blank">www.cuis-smalltalk.org</a><br>
<a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" rel="noreferrer" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a><br>
<a href="https://github.com/jvuletich" rel="noreferrer" target="_blank">https://github.com/jvuletich</a><br>
<a href="https://www.linkedin.com/in/juan-vuletich-75611b3" rel="noreferrer" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a><br>
@JuanVuletich<br>
<br>
</blockquote></div></div>
</div></div></div>