Ada encapsulation and private types
问题 From the compiler's point of view, what's the difference between declaring an Ada type in a package spec or doing it inside the body? 回答1: Generally it is a good practice to make declarations (of types, but also other items like constants or subprograms) the most local possible. In your case if the type is used only in the body and not for users of your package specification (even as private type), put it in the body. Furthermore, if it is used only in a subprogram of the body, put it in that