Johnny Yip
2004-07-09 02:30:42 UTC
Hi,
From the spec
"it is legal to name a variable the same as the procedure
which contains its declaration (i.e., a variable main within the main
procedure is valid)"
But what about following situation?
int A() begin ... end;
...
#main procedure
begin
int A;
A <- A(); # Can I have duplicate ID like this?
end;
I figure that there won't be naming conflicts in terms of using them in
expressions (procedures calls must contain "()" anyway so they will differ
from variable), but not sure if it is OK in terms of the SL spec.
Thanks
Johnny
From the spec
"it is legal to name a variable the same as the procedure
which contains its declaration (i.e., a variable main within the main
procedure is valid)"
But what about following situation?
int A() begin ... end;
...
#main procedure
begin
int A;
A <- A(); # Can I have duplicate ID like this?
end;
I figure that there won't be naming conflicts in terms of using them in
expressions (procedures calls must contain "()" anyway so they will differ
from variable), but not sure if it is OK in terms of the SL spec.
Thanks
Johnny