comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: Update-in-place assignment
Date: Wed, 19 Jun 2002 17:38:53 -0400
Date: 2002-06-19T17:38:53-04:00	[thread overview]
Message-ID: <3D10F9ED.5010801@mail.com> (raw)
In-Reply-To: B936AEC8.1C013%bill@wfindlay.demon.co.uk

Bill Findlay wrote:
> The trouble with the C* "?=" operators, and the derivative proposals made in
> this thread, is that they provide a very restricted subset of a much more
> general facility.
> 
> E.g. we might have  i := idem -1;  or i := 1 - idem;
> or even  x := 0.5 * (1.0 + a*idem);
> 
> What that does not give the C* people is maximal brevity.
> The extra expressiveness should more than compensate.

No. What it *also* does not give the C++ people is a place
to write the code to handle the operation efficiently!
The designer of a class can provide the ?= operators for
that class, and write the code to perform the operation.

With your suggestion, we have the expressiveness, but we
can't do anything with it. If the only goal is to avoid
mentioning a long name more than once, C++ has its version
of a renaming clause just like Ada does:

	double &d = myStruct.itsArray[7].itsPoints[15].z;
	d = (1 + d) / (1 - d);




  reply	other threads:[~2002-06-19 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-19 20:57 Update-in-place assignment Bill Findlay
2002-06-19 21:38 ` Hyman Rosen [this message]
2002-06-20 22:35 ` Jacob Sparre Andersen
2002-06-21 18:18   ` Bill Findlay
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox