comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: [Q]: Unchecked conversion
Date: 1996/11/10
Date: 1996-11-10T00:00:00+00:00	[thread overview]
Message-ID: <dewar.847656210@merv> (raw)
In-Reply-To: 01bbcf21$4b32a020$829d6482@joy.ericsson.se


Jonas asks about conversion of unconstrained array types.

First, the solution with address clauses is of course for CONSTRAINED
array types (since all objects are constrained), and you could perfectly
well use unchecked conversion, or, as I suggested unchecked conversion
of pointers (since there is no need to copy the data) and if all array
types are constrained, then that should be portable.

Note that the solution with address clauses is definitely wrong for
Ada 83 (i.e. erroneous). The effect is implementation dependent in
Ada 95. In practice it will probably work, but I still think that
unchecked conversions of poitners to constrained array subtypes is
a much cleaner approach.

The use of address clauses in this way is really an *ab*use!





  reply	other threads:[~1996-11-10  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-10  0:00 [Q]: Unchecked conversion Jonas Nygren
1996-11-10  0:00 ` Robert Dewar [this message]
1996-11-10  0:00 ` Matthew Heaney
1996-11-10  0:00   ` Robert Dewar
1996-11-11  0:00     ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
1996-11-09  0:00 [Q] : " Jonas Nygren
1996-11-09  0:00 ` Robert Dewar
1996-11-12  0:00 ` Stephen Leake
replies disabled

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