From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4bdb89c75985fc92 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: recursive with Date: 1998/10/02 Message-ID: #1/1 X-Deja-AN: 397169584 References: <36126018.7619@teisa.unican.es> <361272E7.662A074@rol3.com> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-10-02T00:00:00+00:00 List-Id: In article <361272E7.662A074@rol3.com> Alastair Brady writes: > For functions and procdures, if you need to make a call back to the package > which you have been called from, then logically either the current operation > of the operation you wish to call exists in the wrong package. Either they > should all exist in the same package (if they are strongly related) or all > exist in separate packages. Good advice. > For types, it is common to declare a global 'types' package for types which > are common to multiple areas of the system, which is basically just a > package spec which is compiled first, and can then be with'ed by all other > packages. Similarly this can be done for global data, but strictly speaking > all data should be encapsulated and accessed using access functions I'll call this dangerous advice, not really wrong. It leads to bad software engineering if a miscellany of types gets collected in a single package. When this happens the people on the project complain about slow Ada compilers and forget to point the finger in the right place. Get rid of the global package, and you stop generating problems every time one of the 43 people who think they own a type make a "slight" change to it. The only global types package you need should be Standard. (For example, in doing simulations you need times all over the place. I've never had problems using Duration for that time type, but I guess it could happen.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...