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,2907a68906511623 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Idea for Ada 200x: Arguments that are procedures Date: 1998/07/02 Message-ID: #1/1 X-Deja-AN: 368282283 References: <6nh9f0$66i@netline.jpl.nasa.gov> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: 899434406 23143 bpr 206.184.139.132 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-07-02T00:00:00+00:00 List-Id: Hmmm, where have I heard this before! Yes Van, this one is up on my list of "most wanted for Ada 0X" too. The desire for this construct was felt during the Ada 9X design too, see http://sw-eng.falls-church.va.us/AdaIC/standards/95lsn/LSN1083.GeneralAccess The reasons why it isn't in Ada 95 are well known. Hopefullly the same excuse won't be used again, and implementors of display based Ada compilation systems will be ready. Then Ada will be "almost functional" :-) -- Brian On 3 Jul 1998, Van Snyder wrote: > Procedures that are arguments are restricted in Ada because of the > possibility of copying the pointer to somewhere that has a longer > lifetime than the up-level environment of the procedure. > > If an additional attribute were added to formal arguments to indicate > that taking a copy of a procedure pointer is prohibited, restrictions > on procedures that could be arguments could be reduced. > > Since "limited" already puts restrictions on assignment, how about > using that word for the purpose of declaring a formal argument for > which it's prohibited to take a copy. It could only be used to > access a procedure, or passed as an actual argument to a formal > argument that also had the "limited" attribute. > > This would let me have, for example, a library package for quadrature > or minimization or differential equations or ... that exports a type > for a procedure pointer argument, and use a procedure that's internal > to my deep-in-the-guts-of-the-system procedure as the actual argument. > I can't do this now, because the type might outlive the procedure, and > therefore a pointer to the procedure might outlive its up-level. > > -- > What fraction of Americans believe | Van Snyder > Wrestling is real and NASA is fake? | vsnyder@math.jpl.nasa.gov > >