-
Notifications
You must be signed in to change notification settings - Fork 30
Proposal for referring to values at labels #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Proposal for referring to values at labels #182
Conversation
| reference. (visibility as defined by Ada RM is not strict enough, | ||
| as ``statement_identifier`` are implicitly declared in innermost declare block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example to illustrate this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my understanding this means that something like
X := 1;
<<My_Label>>
X := 2;
declare
Y : Integer := 0;
begin
pragma Assert ((X-1)'At (My_Label) = Y);
end;is not allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A label is declared in the innermost declare block enclosing the label. So this would be legal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few lines below: "Furthermore, the statement_identifier referenced by an 'At attribute and the attribute itself shall have the same innermost enclosing body."
To my understanding, this would make it illegal as <<My_Label>> and (X-1)'At (My_Label) do not have the same innermost enclosing body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enclosing body is not the same as enclosing declare block. A "body" refers to a function, procedure, task, or package body.
| a constant at a non-visible (or following) labels. The equivalence also | ||
| means that the scope of the constant is the surrounding sequence of | ||
| statements of the label. In particular, associated finalization will | ||
| occurr at the end of the sequence, rather than immediately after the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "occurr" -> "occur" (there are two similar ones below).
| ``` | ||
|
|
||
| That equivalence implies that it is not allowed to refer to the value of | ||
| a constant at a non-visible (or following) labels. The equivalence also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "label"
No description provided.