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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!mailrus!cornell!uw-beaver!ssc-vax!shuksan!scott From: scott@shuksan.UUCP (Scott Moody) Newsgroups: comp.lang.ada Subject: Re: Procedure types and dynamic binding Summary: C solved the problems Message-ID: <1089@shuksan.UUCP> Date: 14 Jan 89 00:46:50 GMT References: <35339@think.UUCP> <4071@hubcap.UUCP> <8178@aw.sei.cmu.edu> Organization: The Boeing Co., BAC MMST, Seattle, WA List-Id: > > > I haven't done an extended investigation of the literature, but > > procedural variables in Algol-family languages would appear to > > be a research topic > > > The final statement invokes the value of procvar, which is, of course, > "inner". The call of inner references the variable X declared in outer, > which no longer exists. This is the equivalent of the "dangling reference" > problem when the address of a local variable is assigned to a global > pointer. > The C language solves this problem by not allowing 'inner' procedures at all. Of course in C any address could be used and called, but it might not point to anything meaningful. I would thing the bigger problems with procedure parameters is in the parameters to those procedures; especially in Ada where there might be overloaded procedures with very complex arguments. The syntax for specifying - and then checking at runtime that the user supplies the arguments correctly can get very complex. I think Ada's solution of requiring procedures to be supplied to generics is a good compromise between allowing a users code to suddenly jump to somewhere (hopefully not hitting any stars), and not having them at all. I for one wouldn't mind procedure parameters and varaiables, ala C, but I can see that they go against the non goto rational behind Ada. -- scott