comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Question about default discriminants and mutable objects.
Date: Thu, 6 May 2010 07:59:26 -0700 (PDT)
Date: 2010-05-06T07:59:26-07:00	[thread overview]
Message-ID: <04d5b07b-7a14-44c4-ab14-7f3a1b110d3f@d39g2000yqa.googlegroups.com> (raw)
In-Reply-To: 62cb6d15-8436-45d8-978c-3bd98254387d@q30g2000yqd.googlegroups.com

On May 5, 9:56 pm, AdaMagica <christoph.gr...@eurocopter.com> wrote:
> Gene,
> you guessed quite well. See Ada 83 Rationale
>
> http://archive.adaic.com/standards/83rat/html/ratl-04-07.html#4.7
>
> and especially 4.7.4.

I don't think that's a complete explanation, though.  It doesn't
explain why you couldn't have (1) a discriminant type without a
default, in which the initial value of the discriminant must be
specified for each object but the discriminant could still be changed
by assigning the whole object; or (2) a discriminant type with a
default discriminant but where all objects of the type are still
constrained [thus making an object declaration X : T; equivalent to
X : T(default);].  It's probably the inability to do one or both of
those two things that causes the "annoyance" Randy mentioned.

As for why those possibilities couldn't be provided, it's probably
just because they would have had to come up with some funky syntax for
it.  That's not a trivial consideration.  Designing syntax is not
always easy.

                                 -- Adam



  reply	other threads:[~2010-05-06 14:59 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 [this message]
2010-05-07  0:47     ` Peter C. Chapin
2010-05-07  2:07       ` Randy Brukardt
2010-05-07 12:35         ` Robert A Duff
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