From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: A question to the "access-type lifetime rule"
Date: 2000/04/03
Date: 2000-04-03T00:00:00+00:00 [thread overview]
Message-ID: <8caj24$cgg$1@nnrp1.deja.com> (raw)
In-Reply-To: 38E89AB9.7D33E88C@hamilton.physik.uni-konstanz.de
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.
next prev parent reply other threads:[~2000-04-03 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-03 0:00 A question to the "access-type lifetime rule" Bernd Rinn
2000-04-03 0:00 ` David
2000-04-03 0:00 ` Gautier
2000-04-03 0:00 ` Jean-Marc Bourguet
2000-04-03 0:00 ` Robert Dewar [this message]
2000-04-04 0:00 ` John English
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox