Very strange bug on Streams and probably compiler

Klaus D. Witzel klaus.witzel at cobss.com
Sun Feb 25 12:09:37 UTC 2007


Thank you Todd,

I meant the same when mentioning literals made with read-only associations  
earlier.

But Damien is also concerned about passing a subinstance of  
ArrayedCollection (no other type works at the moment) to a WriteStream,  
which, on size overflow, allocates a suitable sized new subinstance ... So  
this also means, it does that for strings.

/Klaus

On Sun, 25 Feb 2007 12:07:54 +0100, you wrote:

> FWIW, ObjectiveC solves this by making literals special subclasses of  
> NSString because they reference data compiled into the static data  
> segment of the executable.  Also NSString's are immutable, subclasses  
> NSMutableString are mutable.  So modification of literals doesn't come  
> up as it produces a DNU type error.
>
> -Todd Blanchard
>
> On Feb 25, 2007, at 2:26 AM, Klaus D. Witzel wrote:
>
>> Hi Damien,
>>
>> on Sat, 24 Feb 2007 23:29:18 +0100, you wrote:
>>> Ok, I may not use the right word. What comment would you write ?
>>
>> I cannot write you that comment. Smalltalk was built with a minimum set  
>> of unchangeable parts, see "Design Principles Behind Smalltalk" just  
>> the sentence after "Good Design"
>>
>> - http://users.ipa.net/~dwighth/smalltalk/byte_aug81/ 
>> design_principles_behind_smalltalk.html
>>
>> Moreover, the design principle does not say minimal, it says minimum.
>>
>> It turned out the only unchangeable parts are instances of SmallInteger  
>> (they are their own oop).
>>
>> Every object (but the SmallIntegers) can be changed and I disagree with  
>> your blaming of the compiler and streams.
>>
>> /Klaus
>>
>>> 2007/2/24, Klaus D. Witzel <klaus.witzel at cobss.com>:
>>>> Hi Damien,
>>>>
>>>> I still think that something is not correct with your analysis. In you
>>>> comments you write:
>>>>
>>>>         "Current compiler uses only one variable for both strings. I  
>>>> think this
>>>> is a bug."
>>>>
>>>> But you do not code a variable, instead you code *literals* which, as  
>>>> was
>>>> mentioned earlier, are also not a constant.
>>>>
>>>> ?
>>>>
>>>> /Klaus
>>>>
>>>> On Sat, 24 Feb 2007 19:14:52 +0100, Damien Cassou wrote:
>>>>
>>>> > I've written unit tests for this compiler "optimizations". I think
>>>> > they show a bug. See attached file.
>>>> >
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
>





More information about the Squeak-dev mailing list