Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mh3bc1.UUCP Path: utzoo!linus!security!genrad!grkermit!mit-vax!eagle!mh3bs!mh3bc1!mdash From: mdash@mh3bc1.UUCP (M.D.Scheer) Newsgroups: net.lang Subject: Re: declarations and nested blocks Message-ID: <112@mh3bc1.UUCP> Date: Wed, 21-Dec-83 16:08:06 EST Article-I.D.: mh3bc1.112 Posted: Wed Dec 21 16:08:06 1983 Date-Received: Fri, 23-Dec-83 01:29:21 EST References: <1072@mit-eddie.UUCP>, <749@sdcrdcf.UUCP> Organization: Bell Labs, Murray Hill Lines: 17 Of course, Ada for loop iterators are implicitly declared, but this does not solve the general problem of unintenionally modifying variables inherited from outer scopes. One solution is to use naming conventions like P_X (subject this construct to the lexical restrictions of your favorite programming language) for the variable X declared in procedure P. This would solve the majority of >accidents< arising from implicit inheritance in nested scopes. Many of the >problems< arising in nested scopes are not accidents, though. Simple nesting is simply an inadequate form of program organization and makes certain problems unavoidable. For a nice discussion of the problems of nested organization, see the paper by Clarke, Wileden, and Wolf, "Nesting in Ada Programs is for the Birds," SIGPLAN Notices, v.15, #11, November 1980.