comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Unknown discriminants with nested records
Date: Fri, 17 Jun 2011 10:50:52 -0400
Date: 2011-06-17T10:50:52-04:00	[thread overview]
Message-ID: <wccwrgkldf7.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 2191e8b5-e827-41e8-b8a0-f02b8a68362c@v10g2000yqn.googlegroups.com

Simon Belmont <sbelmont700@gmail.com> writes:

> Thank you very much, that was the exact answer I was looking for.  I
> was supposing too much about the operation of the unknown discriminent
> marker; I figured it was more of a "known-but-I-won't-tell-you-because-
> you-don't-need-to-know" marker than an actual "unknown", and that the
> compiler would be able to determine that the record in question
> didn't, in fact, have any real discriminents.

If it worked that way, then it would break the contract on the private
type.  That is, you could make changes to the private part that would
affect the legality of clients.  Ada is designed to avoid that sort
of privacy breaking -- the content of the private part should never
affect the legality of any code outside that package.

Jeff Carter is correct about the original reason for the (<>) feature
-- to fix the generic contract model, which was broken in Ada 83.

- Bob



  reply	other threads:[~2011-06-17 14:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 23:53 Unknown discriminants with nested records Simon Belmont
2011-06-17  0:39 ` Adam Beneschan
2011-06-17  1:48   ` Simon Belmont
2011-06-17 14:50     ` Robert A Duff [this message]
2011-06-18  8:33       ` Yannick Duchêne (Hibou57)
2011-06-20 16:16         ` Adam Beneschan
2011-06-17  6:03   ` Jeffrey Carter
replies disabled

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