[Cuis-dev] Language constructs

Hernan Wilkinson hernan.wilkinson at 10pines.com
Wed May 6 11:00:00 PDT 2020


Remember we have the package to make objects inmutable if you want.

Hernan.

On Wed, May 6, 2020 at 11:22 AM Juan Vuletich via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> On 5/1/2020 12:53 PM, Nicolas Cellier via Cuis-dev wrote:
> > For myself, I find the { } syntax very short and useful. I use it a
> > lot even if it reduces a bit portability.
> > Also note that the construct is supported by dedicated byteCodes.
> >
> > I like the Float64Array extension #[ 1.0 3.5 ], maybe it should be
> > generalized in Squeak/Pharo.
>
> Yes!
>
> > But we should also optimize the class with same set as primitives as
> > FloatArray, which is IMO even more useful.
>
> I agree that having the FloatArrays primitives would be great.
> Especially #floatAt: and #floatAt:put:, the simplest ones.
>
> > Note the alternative to backticks that can be used in Squeak: ^[ 0 at 0 ]
> > once.
> > It does not require a new syntax, just an elegant trick.
> > But it costs 3 message send and 2 Dictionary lookup at runtime though...
> > With pre-existing Dolphin ##( 0 at 0 ) we now have at least 2 syntaxes
> > and 3 ways to achieve the same effect in Smalltalk, which is not ideal...
> >
> > I would vote for immutability of all literals including backticks.
> > That's the least surprising.
> > Otherwise, if you mutate the literal, then the code shows a non
> > corresponding value, which is misleading.
>
> I completely agree. Do you know what is the status of immutability in
> Squeak and Pharo? Wasn't the VM work done by Clement a few years ago?
>
> > The first time I was bitten with this was in st80 in the late eighties...
> > I discovered that I could write (WriteStream on: 'some literal') which
> > was much shorter than (WriteStream on String new; nextPutAll: 'same
> > literal'; yourself).
> > But WriteStream did use a become: under the hood when writing past the
> > destination size, and as a newbie, it tooks me some time to understand
> > why my nicer code would not give the expected result twice :)
> >
>
> Yes... Immutable literals would be great.
>
> Thanks,
>
> --
> Juan Vuletich
> www.cuis-smalltalk.org
> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
> https://github.com/jvuletich
> https://www.linkedin.com/in/juan-vuletich-75611b3
> @JuanVuletich
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200506/1b583782/attachment.htm>


More information about the Cuis-dev mailing list