* entries and access parameters
@ 2006-07-13 15:55 Alex R. Mosteo
2006-07-13 17:45 ` Stuart
2006-07-13 20:19 ` Jeffrey R. Carter
0 siblings, 2 replies; 4+ messages in thread
From: Alex R. Mosteo @ 2006-07-13 15:55 UTC (permalink / raw)
Hello,
I'm trying to find in the 95 rationale the explanation for this point
http://www.adahome.com/rm95/rm9x-09-05-02.html
(13) An entry_declaration in a task declaration shall not contain a
specification for an access parameter (See 3.10)
3.10 is simply the section on access types and no mention of entries is
made.
I'm curious about that prohibition, mainly to know if workarounding it with
a type like
type Obj_Access is access all ...
is legal or will give further problems. Gnat compiles these without problem.
I've failed to find anything in the rationale (though I have remembrances of
having read something about this in the past relating to accessibility
checks being the problem). I've found, however, this paragraph in a doc
about Gnat Runtime:
"The entry declaration must be placed inside the task specification. (...)
Access parameters are not permitted, though parameters of any access type
are, of course, allowed."
http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/node21.htm
So I guess the above workaround is legit.
Any comments on why the restriction are welcome! BTW, if the workaround is
legit, I've found a bug in gnatgpl06 that I'll post in a separate message.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: entries and access parameters
2006-07-13 15:55 entries and access parameters Alex R. Mosteo
@ 2006-07-13 17:45 ` Stuart
2006-07-13 17:53 ` Alex R. Mosteo
2006-07-13 20:19 ` Jeffrey R. Carter
1 sibling, 1 reply; 4+ messages in thread
From: Stuart @ 2006-07-13 17:45 UTC (permalink / raw)
"Alex R. Mosteo" <devnull@mailinator.com> wrote in message
news:4hn8k3FdjobU1@individual.net...
> I'm trying to find in the 95 rationale the explanation for this point
>
> http://www.adahome.com/rm95/rm9x-09-05-02.html
>
> (13) An entry_declaration in a task declaration shall not contain a
> specification for an access parameter (See 3.10)
> I'm curious about that prohibition, mainly to know if workarounding it
> with
> a type like
I can't help with the reference to 3.10, but the annotated ARM gives the
following after 9.5.2 (13)
<quote>
Reason: Access parameters for task entries would require a complex
implementation. For example:
task T is
entry E(Z : access Integer); -- Illegal!
end T;
task body T is
begin
declare
type A is access all Integer;
X : A;
Int : aliased Integer;
task Inner;
task body Inner is
begin
T.E(Int'Access);
end Inner;
begin
accept E(Z : access Integer) do
X := A(Z); -- Accessibility_Check
end E;
end;
end T;
Implementing the Accessibility_Check inside the accept_statement for E is
difficult, since one does not know whether the entry caller is calling from
inside the immediately enclosing declare block or from outside it. This
means that the lexical nesting level associated with the designated object
is not sufficient to determine whether the Accessibility_Check should pass
or fail.
Note that such problems do not arise with protected entries, because
entry_bodies are always nested immediately within the protected_body; they
cannot be further nested as can accept_statements, nor can they be called
from within the protected_body (since no entry calls are permitted inside a
protected_body).
</quote>
--
Stuart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: entries and access parameters
2006-07-13 17:45 ` Stuart
@ 2006-07-13 17:53 ` Alex R. Mosteo
0 siblings, 0 replies; 4+ messages in thread
From: Alex R. Mosteo @ 2006-07-13 17:53 UTC (permalink / raw)
Stuart wrote:
> "Alex R. Mosteo" <devnull@mailinator.com> wrote in message
> news:4hn8k3FdjobU1@individual.net...
>> I'm trying to find in the 95 rationale the explanation for this point
>>
>> http://www.adahome.com/rm95/rm9x-09-05-02.html
>>
>> (13) An entry_declaration in a task declaration shall not contain a
>> specification for an access parameter (See 3.10)
>> I'm curious about that prohibition, mainly to know if workarounding it
>> with
>> a type like
>
> I can't help with the reference to 3.10, but the annotated ARM gives the
> following after 9.5.2 (13)
Ahhh thanks, so it was there where I read about it. Now it's coming back.
(removed the relevant part of the aarm).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: entries and access parameters
2006-07-13 15:55 entries and access parameters Alex R. Mosteo
2006-07-13 17:45 ` Stuart
@ 2006-07-13 20:19 ` Jeffrey R. Carter
1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey R. Carter @ 2006-07-13 20:19 UTC (permalink / raw)
Alex R. Mosteo wrote:
>
> I'm curious about that prohibition, mainly to know if workarounding it with
> a type like
>
> type Obj_Access is access all ...
>
> is legal or will give further problems. Gnat compiles these without problem.
That is legal.
--
Jeff Carter
"When Roman engineers built a bridge, they had to stand under it
while the first legion marched across. If programmers today
worked under similar ground rules, they might well find
themselves getting much more interested in Ada!"
Robert Dewar
62
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-13 20:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 15:55 entries and access parameters Alex R. Mosteo
2006-07-13 17:45 ` Stuart
2006-07-13 17:53 ` Alex R. Mosteo
2006-07-13 20:19 ` Jeffrey R. Carter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox