comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: array conversion - how to do?
Date: 1997/07/03
Date: 1997-07-03T00:00:00+00:00	[thread overview]
Message-ID: <dewar.867957369@merv> (raw)
In-Reply-To: 5p3qk2$8mk$1@gonzo.sun3.iaf.nl


Geert says

<<Now I think about it, it is possible to rather closely model
typecasting for arrays by implementing array conversion as
showed below. It is a pity that this generates lots of code
with GNAT although all code could be eliminated. Are there
any compilers that correctly compile this into a null function?
>>

I hope not!

If the body of Error is not available, this is not a valid optimization,
and indeed is typical of the kind of invalid optimizations that optimizing
compilers are sometimes known to do.

(I leave it as an interesting excercise to propose bodies of Error that
can tell this invalid optimization is being performed -- there is more
than once answer!)

Of course this means that your complaint about the conversion still stands,
but you can't go adding major chunks of complexity to a language just so
it can handle one more case efficiently, especially when it is an artifical
case -- I find the use of that subtype of character to be excessive
baggage in the first place.





  reply	other threads:[~1997-07-03  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-24  0:00 array conversion - how to do? Geert Bosch
1997-06-27  0:00 ` Wes Groleau
1997-06-27  0:00   ` Robert Dewar
1997-06-28  0:00     ` Geert Bosch
1997-07-03  0:00       ` Robert Dewar [this message]
1997-07-04  0:00         ` Geert Bosch
1997-07-04  0:00         ` Geert Bosch
1997-07-04  0:00           ` Robert Dewar
1997-06-28  0:00 ` Robert I. Eachus
1997-06-28  0:00   ` Geert Bosch
1997-06-30  0:00     ` Robert I. Eachus
replies disabled

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