[GOODIE] Arithmetic assignments (+= and friends)

Hans-Martin Mosner hmm at heeg.de
Mon Jun 17 11:50:33 UTC 2002


Andreas Raab wrote:
>>	This is cool. I did 4 'printit'. Is the last one 'a *= b'
>>expected ?
>>
>>a := 7 	7
>>b := 5 	5
>>
>>a += b 	12
>>a *= b 	35
> 
> 
> If I do the above in the order written I get 60 as the result of "a *=
> b"; I only get 35 if I don't evaluate "a += b" before. So, yes, that's
> what is expected.
> 
> Cheers,
>   - Andreas
> 
> 

Andreas,
I implemented the SmallScript Syntax (a :+= b) a while ago, and think that I
posted it to the list. Please consider using that syntax, because it visually
implies assignment, and does not interfere with the ability to write binary
selectors *= etc (not that I would want to, but until now you could).

Cheers,
Hans-Martin




More information about the Squeak-dev mailing list