comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: parent package referring to child
Date: Thu, 11 Oct 2007 08:21:34 -0700
Date: 2007-10-11T08:21:34-07:00	[thread overview]
Message-ID: <1192116094.154553.198460@y42g2000hsy.googlegroups.com> (raw)
In-Reply-To: <fek7ll$t11$1@jacob-sparre.dk>

On Oct 10, 9:12 pm, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> "Adam Beneschan" <a...@irvine.com> wrote in message
>
> news:1192047607.865747.220890@50g2000hsm.googlegroups.com...
>
> > On Oct 10, 12:32 pm, Matthew Heaney <mhea...@on2.com> wrote:
> ...
> > > No, that's wrong.  In this case you can use mode inout because type T
> > > is tagged (meaning that it's passed by reference).
>
> > I don't see what the parameter mode has to do with it.
>
> The mode has nothing do to with it; but the rule is that a tagged incomplete
> type (which is what you get in a limited view) can be used as a parameter.
> See 3.101(8.2/2).
>
> >  I can't find a rule that would make "procedure Op (O : in P.C.T);"
>
> illegal.
>
> It's the absence of a rule: see the only allowed uses for incomplete types:
> see 3.10.1(5-9.4/2). Note that 3.10.1(9.4/2) says that no other uses are
> allowed. Use as a parameter is not allowed for untagged types.

Right... I was under the impression that we were assuming T was
tagged.


> > Also, the "by reference" comment isn't relevant either.
>
> It is relevant as it is the reason that tagged incomplete types can be used
> as parameters (because the compiler doesn't need to know the real type in
> order to know how it is passed as a parameter - this same property is needed
> to be able to deal with classwide types which is why it is fundamental to
> tagged types); you don't know that for untagged types so they aren't
> allowed.

Yep, that makes sense.  My point was that using a parameter is illegal
for untagged by-reference types, just as for untagged by-copy types.
But if you're looking at a limited view, you aren't allowed to know
enough about the type to know whether an untagged type is by-reference
or by-copy.  I missed that---thanks for the explanation.

                  -- Adam




  reply	other threads:[~2007-10-11 15:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-10  6:23 parent package referring to child eliben
2007-10-10  9:07 ` Georg Bauhaus
2007-10-10  9:24   ` eliben
2007-10-10 14:46     ` Adam Beneschan
2007-10-10 19:26   ` Simon Wright
2007-10-10 14:59 ` Matthew Heaney
2007-10-10 18:54   ` Vadim Godunko
2007-10-10 19:32     ` Matthew Heaney
2007-10-10 20:20       ` Adam Beneschan
2007-10-11  4:12         ` Randy Brukardt
2007-10-11 15:21           ` Adam Beneschan [this message]
2007-10-19 12:45           ` Vadim Godunko
2007-10-10 19:51   ` Matthew Heaney
2007-10-10 17:06 ` Jeffrey R. Carter
2007-10-10 19:17 ` anon
2007-10-11  9:45 ` george
2007-10-12  4:15   ` Jeffrey R. Carter
2007-10-12  9:51     ` Georg Bauhaus
replies disabled

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