[squeak-dev] TestRunner not assigning strings/remembering old values of temp vars.

Rob Withers reefedjib at yahoo.com
Sun Jul 25 08:22:35 UTC 2010



--------------------------------------------------
From: "Nicolas Cellier" <nicolas.cellier.aka.nice at gmail.com>
Sent: Sunday, July 25, 2010 4:19 AM
To: "The general-purpose Squeak developers list" 
<squeak-dev at lists.squeakfoundation.org>
Subject: Re: [squeak-dev] TestRunner not assigning strings/remembering old 
values of temp vars.

> 2010/7/25 Rob Withers <reefedjib at yahoo.com>:
>>
>>
>> --------------------------------------------------
>> From: "Nicolas Cellier" <nicolas.cellier.aka.nice at gmail.com>
>> Sent: Sunday, July 25, 2010 4:09 AM
>> To: "The general-purpose Squeak developers list"
>> <squeak-dev at lists.squeakfoundation.org>
>> Subject: Re: [squeak-dev] TestRunner not assigning strings/remembering 
>> old
>> values of temp vars.
>>
>>> There is no immutable support in Squeak.
>>> Smalltalk custom is to avoid overwriting literals like String Array...
>>> ...Same for instances of other classes like Point Rectangle which are
>>> likely to be shared by several objects.
>>> Most algorithms will rather modify and answer a copy.
>>> This default behaviour has a cost (creates lots of objects) but is
>>> fool proof (no danger to overwrite a shared information).
>>>
>>> For DES, I don't know, maybe it's just an optimization you must be aware
>>> of.
>>> In that case, you are responsible for creating the copy by yourself
>>> when required.
>>
>>
>> You mean before calling encryptBlock:/decryptBlock: with string data, we
>> should copy the string data.  That's unfortunate.  It works fine with
>> ByteArrays.
>>
>
> No, if you use a literal ByteArray with #[   ] notations, you'll get
> same symptoms as with a String literal.
>

Thanks for pointing this out.  I am not happy about this at all.  It is very 
non-intuitive, all due to an optimization that limits my expressiveness.

Rob 




More information about the Squeak-dev mailing list