From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Extend slices for n dimensional arrays for Ada 202X
Date: Sat, 28 Jan 2017 10:08:54 +0100
Date: 2017-01-28T10:08:54+01:00 [thread overview]
Message-ID: <o6hn36$1b15$1@gioia.aioe.org> (raw)
In-Reply-To: o6gljt$3pv$1@franka.jacob-sparre.dk
On 2017-01-28 00:37, Randy Brukardt wrote:
> ... general slices really don't fit very well into any type model since they're
> a different shape (in general) than the originating array type.
It depends on the slice. When some dimensions are collapsed the result
is a different but related type. When all dimensions are retained the
type is same (or equivalent).
You consider a scenario where the array and its "full" slice have the
same representation like in Ada 83. It would mean either keeping actual
constraints in the object (bad) or else providing a universal mechanism
of user-defined constraints passed along with the object. [Generic user
constraints]
Another method is using a class-wide operation where both array and
slice are expected. Slice would be a sibling type of different
representation, both array and slice derived from the same abstract parent.
P.S. My vision of ideal Ada is when its type system would allow moving
built-in arrays and records into the specification of the package
Standard. [Tagged types should have had nothing to do with record types.]
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
prev parent reply other threads:[~2017-01-28 9:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 13:29 REQ: Extend slices for n dimensional arrays for Ada 202X Lucretia
2017-01-26 14:01 ` Lucretia
2017-01-26 14:03 ` Lucretia
2017-01-26 14:52 ` Dmitry A. Kazakov
2017-01-27 9:19 ` Alejandro R. Mosteo
2017-01-27 14:04 ` Lucretia
2017-01-26 18:29 ` Randy Brukardt
2017-01-27 1:54 ` Robert Eachus
2017-01-27 5:39 ` Robert Eachus
2017-01-27 14:06 ` Lucretia
2017-01-27 23:30 ` Randy Brukardt
2017-01-28 0:58 ` Robert Eachus
2017-01-27 9:34 ` Dmitry A. Kazakov
2017-01-27 13:53 ` G.B.
2017-01-27 14:20 ` Dmitry A. Kazakov
2017-01-27 23:37 ` Randy Brukardt
2017-01-28 9:08 ` Dmitry A. Kazakov [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox