comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Dynamic Variant Record Creation
Date: Tue, 16 Mar 2010 16:24:33 -0700 (PDT)
Date: 2010-03-16T16:24:33-07:00	[thread overview]
Message-ID: <68c5e203-8757-463b-8124-145fa1e80041@l12g2000prg.googlegroups.com> (raw)
In-Reply-To: wccljdsnh48.fsf@shell01.TheWorld.com

On Mar 16, 1:31�pm, Robert A Duff <bobd...@shell01.TheWorld.com>
wrote:
> Warren <ve3...@gmail.com> writes:
> > Of course. But it is not conceptually inconceivable to
> > check this at runtime and realize that the value I handed
> > out will work with what was provided. If not, then
> > raise an exception.
>
> Not inconceivable, I suppose, but that would be a huge language
> change. �It would require totally rethinking the overload
> resolution rules, because currently there's a fundamental
> principle that the type of an aggregate is determined by
> context (ignoring the components), and once that type is
> known, the component expressions are resolved knowing
> their types.
>
> I really don't think you want to do overload resolution at
> run time.

Actually, I don't think overload resolution would be an issue, as long
as the aggregate (or at least the components that are in variant
parts) is specified using named associations.  As you said, the
information about the components isn't used to determine the expected
type of the aggregate.  Once the type is determined from context, the
names of the variant components would be enough to determine which
variants must be present, and therefore what the allowable values of
the governing discriminant(s) are.  (And, of course, if two component
names are specified that cannot exist at the same time, it's already
illegal.)  However, this wouldn't work if positional notation is used,
and this inconsistency (discriminants must be static if components are
in positional notation but need not be if they use named associations)
would be enough reason for me to say this is a bad idea, if I didn't
already think it was, which I do.

                                    -- Adam







  parent reply	other threads:[~2010-03-16 23:24 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 17:11 Dynamic Variant Record Creation Warren
2010-03-16 18:31 ` Georg Bauhaus
2010-03-16 18:57 ` Adam Beneschan
2010-03-16 20:01   ` Warren
2010-03-16 20:09     ` Jeffrey R. Carter
2010-03-16 20:24       ` Warren
2010-03-16 20:40         ` Robert A Duff
2010-03-16 20:44           ` Warren
2010-03-16 20:31     ` Robert A Duff
2010-03-16 20:59       ` Warren
2010-03-16 21:55         ` Jeffrey R. Carter
2010-03-17 14:40           ` Warren
2010-03-18 12:57           ` Warren
2010-03-16 21:58         ` Robert A Duff
2010-03-17 14:22           ` Charmed Snark
2010-03-17 14:49             ` Robert A Duff
2010-03-17 16:30               ` Warren
2010-03-16 21:15       ` Adam Beneschan
2010-03-16 23:24       ` Adam Beneschan [this message]
2010-03-16 20:15   ` Robert A Duff
2010-03-16 21:00     ` Warren
2010-03-16 23:39   ` Randy Brukardt
2010-03-16 23:43     ` Randy Brukardt
2010-03-17  0:15     ` Robert A Duff
2010-03-17 14:28       ` Warren
2010-03-18  0:02       ` Randy Brukardt
2010-03-17  4:20     ` Adam Beneschan
2010-03-18  0:13       ` Randy Brukardt
2010-03-18 13:00         ` Warren
replies disabled

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