Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!cbatt!cbosgd!ihnp4!inuxc!iuvax!cjl From: cjl@iuvax.UUCP Newsgroups: net.lang Subject: Re: Re: nested procedures. Message-ID: <11800025@iuvax.UUCP> Date: Wed, 13-Aug-86 12:40:00 EDT Article-I.D.: iuvax.11800025 Posted: Wed Aug 13 12:40:00 1986 Date-Received: Fri, 15-Aug-86 20:44:57 EDT References: <7026@boring.UUCP> Lines: 24 Nf-ID: #R:boring:-702600:iuvax:11800025:000:1142 Nf-From: iuvax!cjl Aug 13 11:40:00 1986 > It also requires a new version of forEach for every different type of action > procedure you need to call. Even the example program requires two: one for > writeElement which has a boolean parameter, and another for loop which has a > 'location' parameter. A procedure without procedure parameters can be asserted with pre- and post-conditions. The inclusion of procedure parameters makes it almost impossible to assert the pre- and post-conditions. In other words procedures with procedure parameters are just control macros, not solid abstraction. This may be the reason why Ada eliminates procedure parameters. In Ada, you can only have generic procedures with procedure parameters. You must instantiate generic procedures for each use of different procedure parameters. That enforces the abstraction and descent use of every procedure. If this represents a good software engineering principle, then it may be better to write two different versions of forEach for this example than to share codes with one forEach and non-local variable references. C.J.Lo Dept. of CIS, IUPUI UUCP : ...!iuvax!cjl ARPA : cjl@Indiana@CSNet-Relay