[BUG] Compiler, become: and String literals.

Andreas Raab andreas.raab at gmx.de
Fri Sep 19 12:42:21 UTC 2003


> This makes no sense to me. I suspect the compiler may be 
> doing something odd with String literals.

The compiler merges string literals. E.g.,

a := 'ab'.
a == 'ab' => true.

Therefore after the become operation, even though your code _reads_ "a =
'cd'" it is actually evaluating "a = 'ab'".

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Brent Pinkney
> Sent: Friday, September 19, 2003 2:31 PM
> To: The general-purpose Squeak developers list
> Subject: [BUG] Compiler, become: and String literals.
> 
> 
> Hi,
> 
> I need some help.
> 
> If I print this in a workspace (or even code it in a method) I get
> 
> a := 'ab'.
> b := 'cd'.
> a become: b.
> a = 'cd'
> 
> --> false
> 
> However
> 
> a := 'ab' copy.
> b := 'cd' copy.
> a become: b.
> a = 'cd'
> 
> --> true.
> 
> This makes no sense to me. I suspect the compiler may be 
> doing something 
> odd with String literals.
> 
> Is this a bug or how it should work ?
> 
> Cheers
> 
> Brent
> 
> 
> 



More information about the Squeak-dev mailing list