comp.lang.ada
 help / color / mirror / Atom feed
* Language lawyer question: Limited Views
@ 2008-12-31 17:59 Maxim Reznik
  2009-01-05 17:01 ` Adam Beneschan
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Reznik @ 2008-12-31 17:59 UTC (permalink / raw)


Consider
package Pkg is
   type T;
   type T is null record;
end Pkg;

According to 10.1.1(12.3/2)
"The limited view of a package contains: ... For each type_declaration
in the visible part, an incomplete view of the type..."

limited view for it would be:

package limited view Pkg is
   type T;  --  for declaration type T;
   type T;  --  for declaration type T is null record;
end Pkg;

Why two implicit declaration of T are allowed here?
Is second "type T;" completion for first?

PS Happy New Year!
--
Maxim Reznik



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Language lawyer question: Limited Views
  2008-12-31 17:59 Language lawyer question: Limited Views Maxim Reznik
@ 2009-01-05 17:01 ` Adam Beneschan
  2009-01-05 19:32   ` Maxim Reznik
  2009-01-06  1:30   ` Randy Brukardt
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Beneschan @ 2009-01-05 17:01 UTC (permalink / raw)


On Dec 31 2008, 9:59 am, Maxim Reznik <rezni...@gmail.com> wrote:
> Consider
> package Pkg is
>    type T;
>    type T is null record;
> end Pkg;
>
> According to 10.1.1(12.3/2)
> "The limited view of a package contains: ... For each type_declaration
> in the visible part, an incomplete view of the type..."
>
> limited view for it would be:
>
> package limited view Pkg is
>    type T;  --  for declaration type T;
>    type T;  --  for declaration type T is null record;
> end Pkg;
>
> Why two implicit declaration of T are allowed here?
> Is second "type T;" completion for first?

I suppose the answer is that the RM says that the implicit declaration
of the limited view contains an "incomplete view" of a type, not an
actual "type declaration", so the syntax rules having to do with
declarations don't actually apply since these are not really
declarations.  In any case, I wouldn't worry about it; the limited
view contains an incomplete view of T.  I'm someone who worries a lot
about the tiniest potential ambiguities in the RM, but even this one
doesn't concern me at all.

                                 -- Adam




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Language lawyer question: Limited Views
  2009-01-05 17:01 ` Adam Beneschan
@ 2009-01-05 19:32   ` Maxim Reznik
  2009-01-05 22:20     ` Adam Beneschan
  2009-01-06  1:30   ` Randy Brukardt
  1 sibling, 1 reply; 5+ messages in thread
From: Maxim Reznik @ 2009-01-05 19:32 UTC (permalink / raw)


On 5 янв, 19:01, Adam Beneschan <a...@irvine.com> wrote:
> I suppose the answer is that the RM says that the implicit declaration
> of the limited view contains an "incomplete view" of a type, not an
> actual "type declaration", so the syntax rules having to do with
> declarations don't actually apply since these are not really
> declarations.  In any case, I wouldn't worry about it; the limited
> view contains an incomplete view of T.  I'm someone who worries a lot
> about the tiniest potential ambiguities in the RM, but even this one
> doesn't concern me at all.
>
>                                  -- Adam

Thanks
I encountered an error in my ASIS implementation, when it complains
about name redeclaration in such case. And I don't know which way to
fix it:
 * make only one type declaration/incomplete view, or
 * make two implicit declarations, but let one be completion for/or
hide another

That's why I'm asking.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Language lawyer question: Limited Views
  2009-01-05 19:32   ` Maxim Reznik
@ 2009-01-05 22:20     ` Adam Beneschan
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Beneschan @ 2009-01-05 22:20 UTC (permalink / raw)


On Jan 5, 11:32 am, Maxim Reznik <rezni...@gmail.com> wrote:
> On 5 ÑÎ×, 19:01, Adam Beneschan <a...@irvine.com> wrote:
>
> > I suppose the answer is that the RM says that the implicit declaration
> > of the limited view contains an "incomplete view" of a type, not an
> > actual "type declaration", so the syntax rules having to do with
> > declarations don't actually apply since these are not really
> > declarations.  In any case, I wouldn't worry about it; the limited
> > view contains an incomplete view of T.  I'm someone who worries a lot
> > about the tiniest potential ambiguities in the RM, but even this one
> > doesn't concern me at all.
>
> >                                  -- Adam
>
> Thanks
> I encountered an error in my ASIS implementation, when it complains
> about name redeclaration in such case. And I don't know which way to
> fix it:
>  * make only one type declaration/incomplete view, or
>  * make two implicit declarations, but let one be completion for/or
> hide another
>
> That's why I'm asking.


I'm not really sure what you're trying to do.  But note that if you
create a "limited view" by replacing visible type declarations with
incomplete type declarations, the result will not be legal Ada in any
case, since incomplete types are supposed to have completions, in an
Ada package, but the "limited view" has a lot of incomplete types
without completions.  So if some program accepts some things in a
limited view that aren't legal in Ada, it shouldn't be an issue to
have it accept one more thing, such as a redeclaration.  This may or
may not be relevant to your question, since I really have no idea what
you're trying to accomplish.

                               -- Adam



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Language lawyer question: Limited Views
  2009-01-05 17:01 ` Adam Beneschan
  2009-01-05 19:32   ` Maxim Reznik
@ 2009-01-06  1:30   ` Randy Brukardt
  1 sibling, 0 replies; 5+ messages in thread
From: Randy Brukardt @ 2009-01-06  1:30 UTC (permalink / raw)


"Adam Beneschan" <adam@irvine.com> wrote in message 
news:ae84f74a-3943-4b8b-916a-ca107c07e5b0@a26g2000prf.googlegroups.com...
> On Dec 31 2008, 9:59 am, Maxim Reznik <rezni...@gmail.com> wrote:
>> Consider
>> package Pkg is
>>    type T;
>>    type T is null record;
>> end Pkg;
>>
>> According to 10.1.1(12.3/2)
>> "The limited view of a package contains: ... For each type_declaration
>> in the visible part, an incomplete view of the type..."
>>
>> limited view for it would be:
>>
>> package limited view Pkg is
>>    type T;  --  for declaration type T;
>>    type T;  --  for declaration type T is null record;
>> end Pkg;
>>
>> Why two implicit declaration of T are allowed here?
>> Is second "type T;" completion for first?
>
> I suppose the answer is that the RM says that the implicit declaration
> of the limited view contains an "incomplete view" of a type, not an
> actual "type declaration", so the syntax rules having to do with
> declarations don't actually apply since these are not really
> declarations.  In any case, I wouldn't worry about it; the limited
> view contains an incomplete view of T.  I'm someone who worries a lot
> about the tiniest potential ambiguities in the RM, but even this one
> doesn't concern me at all.

Gee, Adam, you must be slipping. *I* was concerned about this very problem 
when I ran across it in the context of a question raised during the Portland 
ARG meeting. The rules are pretty clearly wrong, IMHO. See AI05-0129-1, 
which I created to fix that situation (note, dated November 23rd, 2008).

                                            Randy.

P.S. Maxim may not have noted the AI as I think it was first posted very 
recently. 





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-06  1:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-31 17:59 Language lawyer question: Limited Views Maxim Reznik
2009-01-05 17:01 ` Adam Beneschan
2009-01-05 19:32   ` Maxim Reznik
2009-01-05 22:20     ` Adam Beneschan
2009-01-06  1:30   ` Randy Brukardt

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