comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Question about default discriminants and mutable objects.
Date: Fri, 07 May 2010 08:35:54 -0400
Date: 2010-05-07T08:35:54-04:00	[thread overview]
Message-ID: <wcc8w7vlwid.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: hrvskb$p67$1@munin.nbi.dk

"Randy Brukardt" <randy@rrsoftware.com> writes:

> Remember that there are three of them: one each for Ada 83, Ada 95, and Ada 
> 2005. Depending on the feature, you might need to look at all three. (Not 
> sure if there will be one for Ada 2012.)

Right.  Also, for very detailed design decisions, look at the AARM
for rationale.  That's not available for Ada 83 -- I think
Jean Ichbiah was not a "detail man".  ;-)

As to default discriminants causing mutable discriminants,
despite the rationale, it's a bad design.  It's confusing.
And it means you can't use defaults just as defaults when
you want immutable discriminants.  Except you CAN do
that for limited types (more confusion).  And for '[in] out'
parameters, you don't know at compile time whether the
thing is mutable, which is just a tripping hazard.

Also, some compilers chose the deallocate/reallocate
strategy, and others chose the allocate-the-max
strategy.  That's bad; it means you can't use the
feature portably.  Standards are supposed to promote
uniformity.

- Bob



  reply	other threads:[~2010-05-07 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06  0:41 Question about default discriminants and mutable objects Peter C. Chapin
2010-05-06  1:26 ` Randy Brukardt
2010-05-06  4:07 ` Gene
2010-05-06  4:56   ` AdaMagica
2010-05-06 14:59     ` Adam Beneschan
2010-05-07  0:47     ` Peter C. Chapin
2010-05-07  2:07       ` Randy Brukardt
2010-05-07 12:35         ` Robert A Duff [this message]
2010-05-06 15:15 ` Dmitry A. Kazakov
replies disabled

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