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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6b9934af04bce01 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: A question to the "access-type lifetime rule" Date: 2000/04/03 Message-ID: <8caj24$cgg$1@nnrp1.deja.com>#1/1 X-Deja-AN: 606127981 References: <38E89AB9.7D33E88C@hamilton.physik.uni-konstanz.de> X-Http-Proxy: 1.0 x37.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Apr 03 17:06:25 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-03T00:00:00+00:00 List-Id: In article <38E89AB9.7D33E88C@hamilton.physik.uni-konstanz.de>, bernd.rinn@uni-konstanz.de wrote: > I want to write an numerical integration function, that is > defined in a separate package as This is a classical case where the use of a generic is far preferable from every point of view. Forget about pointers to subprograms completely, this is not what they are for in Ada! Nested functions and pointers-to-functions do not go well together. That is why C, C++, Ada and many other languages avoid this combination. Ada 95 allows the combination but restricts it to be safe. GNAT+Unrestricted_Access and GNU C allow the unrestricted combination, but this is definitely programmer-beware territory since dangling procedure pointers are about as horrible a disaster as one can imagine. Sent via Deja.com http://www.deja.com/ Before you buy.