[GOODIE] Arithmetic assignments (+= and friends)

PhiHo Hoang phiho.hoang at rogers.com
Mon Jun 17 15:07:00 UTC 2002


Hi Diego,

> ... try to remove the assigment (the only not a message thing)

    This would be cool, I like it too.

    Please post it here when you have some good news ;-)

    OTOH, assignment has been hanging around for decades, a little
enhancement doesn't hurt that much ;-)

    Cheers,

    PhiHo.

----- Original Message -----
From: "Diego Gomez Deck" <DiegoGomezDeck at ConsultAr.com>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Monday, June 17, 2002 10:00 AM
Subject: RE: [GOODIE] Arithmetic assignments (+= and friends)


> 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