comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Why should the value for a discriminant be static?
Date: Wed, 9 Feb 2005 12:34:41 -0600
Date: 2005-02-09T12:34:41-06:00	[thread overview]
Message-ID: <w9mdnb75ofjLypffRVn-tw@megapath.net> (raw)
In-Reply-To: rlszmyd956d.fsf@jacob.crs4.it

"Jacob Sparre Andersen" <sparre@nbi.dk> wrote in message
news:rlszmyd956d.fsf@jacob.crs4.it...
> Occasionally I run into the limitation that the value for a
> discriminant be static.  I can design my way around the limitation
> (when I remember it), but I would like to know the reason.  (also
> because it might make it easier for me to remember the rule)

The only place I know of off-hand where there is such a limitation is with
aggregates. There, the limitation is necessary so that compiler can know the
set of components for the aggregate. Otherwise, it would be impossible to
check that components are given, which is *the* major benefit of using an
aggregate over a series of component assignments.

I suppose such a check could be done at runtime, but that would be
substantially less safe, as errors could exist in a program for a long time
and occur only in unusual conditions after deployment.

Anyway, does that answer your question, or was this in some other context?

                 Randy Brukardt







  reply	other threads:[~2005-02-09 18:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09 14:30 Why should the value for a discriminant be static? Jacob Sparre Andersen
2005-02-09 18:34 ` Randy Brukardt [this message]
2005-02-09 20:16   ` Niklas Holsti
2005-02-10  0:19     ` Jeffrey Carter
2005-02-10 13:11       ` Niklas Holsti
2005-02-11  1:40         ` Jeffrey Carter
2005-02-11  7:52           ` Niklas Holsti
2005-02-09 22:22   ` Jacob Sparre Andersen
replies disabled

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