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,e94a7e4f6f888766 X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: Self-referential types Date: 1999/10/15 Message-ID: <38077EB3.E6911567@mitre.org>#1/1 X-Deja-AN: 537194551 Content-Transfer-Encoding: 7bit References: <7ttb4a$8mq$1@nnrp1.deja.com> <3802f2db_2@news1.prserv.net> <3803B5E3.F96A6DD4@mitre.org> <3803c8bc_2@news1.prserv.net> <3804E7E0.6A0265FB@mitre.org> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.mitre.org X-Trace: top.mitre.org 940014976 18630 129.83.41.77 (15 Oct 1999 19:16:16 GMT) Organization: The MITRE Corporation Mime-Version: 1.0 NNTP-Posting-Date: 15 Oct 1999 19:16:16 GMT Newsgroups: comp.lang.ada Date: 1999-10-15T19:16:16+00:00 List-Id: Brian Rogoff wrote: > Does it discuss the detrimental effect on lots of other aspects of Ada > when you remove nesting of procedures? Okay, I'll bite what are they? Note that nesting of procedures refers to procedures declared inside other procedures, not procedures called inside other procedures, or within packages. AFIAK, it is almost always poor engineering to declare procedures within other procedures in Ada. The chief exception is recursive descent parsers, and even in that case there are good arguments for using unnested procedures. Also there are cases where you want to break a procedure into subunits for implementation reasons: procedure A (Some: Parameters) is Some_Local: Variables; procedure Start is separate; -- Ed will write procedure Do_It is separate; -- Joe is doing this procedure Cleanup is separate; -- Ed again begin Start; Do_It; Cleanup; end A; Often though, those separates disappear before the code is entered into the CM system. Ada lets fold called once procedures back in as declare blocks with no change in semantic interpretation. Note also that I am talking about procedures. Many (nested)functions in Ada would be implemented in other languages as macros. Using such inlined functions is good programming practice in Ada. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...