[GOODIE] Arithmetic assignments (+= and friends)

Diego Gomez Deck DiegoGomezDeck at ConsultAr.com
Mon Jun 17 14:00:08 UTC 2002


Hello,

To say the true, I don't like any option.

Please leave the assigment just like today.   Both option only add complexity to the language definition, more to teach, more to learn.

If you want, try to remove the assigment (the only not a message thing) and not to expand it.

We ever said: "Object & Messages, all that you need.", then we said not so loudly "and assigments". That's is enough complexity to explain.

Cheers,

Diego Gomez Deck


>On Mon, 17 Jun 2002, Andreas Raab wrote:
>
>> > and does not interfere with the ability 
>> > to write binary selectors *= etc (not that I would want to, but
>> > until now you could).
>> 
>> Well, the only uses I've seen sofar were inplace operations (and I wrote
>> 'em ;-) Note that the ability to write binary selectors of this form
>> could be obtained by seeing if the left hand side is a variable (then,
>> the only requirement for the implementation would be that it returns
>> self) but it appears to me that it's a somewhat useless exercise...
>
>I don't have a nice solution, but there are situations in which it would
>be usefull to distinguish between :+= (which expands to := and +=) and +=
>(a normal message send). Like, when the receiver itself is a parameter
>instead of a temp. I think it's not too far-fetched to use an inplace
>modifying loop like
>
>	coll do: [:each | each += something]
>
>which would not work anymore with your approach. 
>
>-- Bert




More information about the Squeak-dev mailing list