D
David Jones
Guest
From VHDL-93 LRM section 10.3, page 144, lines 143-144:
Within the specification of a subprogram, every declaration with the same
designator as the subprogram is hidden. Where hidden in this manner, a
declaration is visible neither by selection nor directly.
Read one way, a subprogram declaration has the same designator as itself,
therefore it should be hidden within the specification of the subprogram.
As a consequence, it should not be possible to call a subprogram recursively.
Casual experimentation with VHDL Simili indicates that this is not so (i.e.
recursion is possible) and I would be surprised if recursion were not possible.
If I try to overload a subprogram name as a signal, then I'm creating a
homograph, and we already have rules to deal with that. If I try to overload
a subprogram name as another subprogram, that works, and one overloaded
subprogram can even call the other!
Can someone clarify exactly what the spec is trying to prevent and why?
Within the specification of a subprogram, every declaration with the same
designator as the subprogram is hidden. Where hidden in this manner, a
declaration is visible neither by selection nor directly.
Read one way, a subprogram declaration has the same designator as itself,
therefore it should be hidden within the specification of the subprogram.
As a consequence, it should not be possible to call a subprogram recursively.
Casual experimentation with VHDL Simili indicates that this is not so (i.e.
recursion is possible) and I would be surprised if recursion were not possible.
If I try to overload a subprogram name as a signal, then I'm creating a
homograph, and we already have rules to deal with that. If I try to overload
a subprogram name as another subprogram, that works, and one overloaded
subprogram can even call the other!
Can someone clarify exactly what the spec is trying to prevent and why?