comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Array slices and types
Date: Thu, 21 Aug 2008 17:46:08 +0200
Date: 2008-08-21T17:46:11+02:00	[thread overview]
Message-ID: <7oae0iwhszmm.cazomantciz3.dlg@40tude.net> (raw)
In-Reply-To: fc112b42-285c-4ed5-ae78-34be4e60f6df@i20g2000prf.googlegroups.com

On Thu, 21 Aug 2008 07:44:29 -0700 (PDT), Adam Beneschan wrote:

> Sorry, Dmitry, but if you'll pardon the expression, you're a little
> off-base here.  S'Base and S are subtypes of the same *type*.

No need to excuse, you are right, I don't see any semantic difference
between subtypes of "same" type and derived tagged types. Consequently, I
don't think it is worth to further maintain such difference in the
language.

> They
> may be different subtypes (have different constraints), but they're
> the same type.  You're asking for an attribute that would give you a
> different type.

Yep, for that matter, tag is merely a constraint put on T'Class. Ada 83
model is capable to incorporate OO! We always knew that! (:-))

> There may be merit in having such an attribute (I
> haven't looked into it closely), but calling it 'Base would be a bad
> idea.  S'Parent might be better.

Integer'Parent were Universal_Integer, I guess (:-))

> Niklas is asking for S'Base to be the unconstrained array subtype of
> the (possibly constrained) array subtype S.  It would still fit into
> the definition of 'Base (3.5(15)).  I'm not sure why this wasn't
> defined for array subtypes, or for any other type that could have
> discriminants; offhand I don't see how this would cause any problems.

I think that the reason was that S'Base was thought as a very low-level
thing, something like the least constrained type of the *same* internal
representation. For unconstrained arrays the representation is likely not
the same, they might have a dope. For other types nobody seemingly cared.
(:-))

IMO, if S'Base need to be extended, then that would require a bit firmer
foundation than the above.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2008-08-21 15:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 14:51 Array slices and types Maciej Sobczak
2008-08-20 15:26 ` Niklas Holsti
2008-08-20 15:46 ` Dmitry A. Kazakov
2008-08-20 18:52   ` Niklas Holsti
2008-08-20 20:01     ` Simon Wright
2008-08-21  5:26       ` Niklas Holsti
2008-08-21  8:53         ` Dmitry A. Kazakov
2008-08-21 14:44           ` Adam Beneschan
2008-08-21 15:46             ` Dmitry A. Kazakov [this message]
2008-08-22  4:30             ` Randy Brukardt
2008-08-20 17:47 ` stefan-lucks
2008-08-20 17:51   ` stefan-lucks
2008-08-20 20:45 ` Adam Beneschan
2008-08-21 21:16   ` Maciej Sobczak
2008-08-23  2:50 ` Steve
replies disabled

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