[Cuis-dev] Immutability package

Juan Vuletich juan at jvuletich.org
Fri May 8 06:15:17 PDT 2020


On 5/7/2020 3:56 PM, Hernan Wilkinson via Cuis-dev wrote:
> Hi,
>  I just added to Cuis-Smalltalk-Dev/Packages/System a package to set 
> an object as immutable.
>  The package name is Immutability.pck.st <http://Immutability.pck.st> 
> and it has tests in ImmutabilityTest.pck.st 
> <http://ImmutabilityTest.pck.st>
>
>  To make an object immutable just send the message #beImmutable to it. 
> To make it mutable #beMutable.
>  If you try to modify an immutable object the ModificationForbidden 
> exception will be signal which is resumable.
>
>  Please, look at the tests for more examples.
>
> Cheers!
> Hernan.
>
> -- 
> *Hernán Wilkinson
> Agile 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

Very nice, Thanks!

Next steps include how to make method literals be immutable.

Something else that would be great is to gradually make Strings 
immutable. That would allow us to replace String with Rope if desired.

Cheers,

-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200508/1ad5695c/attachment.htm>


More information about the Cuis-dev mailing list