From: milne@ICSE.UCI.EDU (Alastair Milne)
Subject: Re: Enumerated "procedural" parameters
Date: Sun, 22-Jun-86 03:49:52 EDT [thread overview]
Date: Sun Jun 22 03:49:52 1986
Message-ID: <8606220749.AA27775@ucbvax.Berkeley.EDU> (raw)
In-Reply-To: 4700042@ada-uts
Using an enumeration-indexed case to choose the procedure to be called
will work if all the procedures to be called are known and available at
the time that case is compiled. It will therefore work if all the
enumeration-passing calls are in the same program unit as the case, or if
they are exported by a package which will permit only "procedures" known
to it (its own, or others from packages used in the specification) to be
passed in.
It will not work in a library package exporting routines to be applied to
routines from units not known to the package. Routines that come to mind
immediately are in the field of numeric analysis: curve fitting, best fits,
adaptive quadrature, etc. . In these cases what one needs is a routine
which, given some routine x to produce original function values, calls
that routine as it needs for input to its own algorithm. Such packages
would be essential parts of libraries for numeric analysis. Their routines
could be applied to any data-producing routine a user supplied,
with algorithms 50 years old or produced yesterday. But in Ada, the old
approach of simply passing that routine as another parameter is
not available.
A good point has already been made on this board that in using Ada, one
can find that the way one used to do something is no longer available,
only to discover that it can be done in new and superior, more secure ways.
I hope that will turn out to be so of this case.
Alastair Milne
next prev parent reply other threads:[~1986-06-22 7:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1986-05-28 15:54 ForTran-Ada + flamette + question richw
1986-05-30 12:46 ` Russ Holden
1986-06-20 15:36 ` ForTran-Ada + flamette + questi richw
1986-06-22 3:00 ` Russ Holden
1986-06-22 7:49 ` Alastair Milne [this message]
1986-07-03 7:03 ` Enumerated "procedural" parameters Dick Dunn
1986-07-10 22:26 ` ForTran-Ada + flamette + questi friesen
1986-07-11 15:38 ` ForTran-Ada ... (really function pointers) markb
1986-07-14 17:01 ` ForTran-Ada + flamette + questi richw
1986-07-18 21:59 ` vilot
1986-07-22 12:59 ` stt
1986-08-07 13:26 ` Christopher Reedy
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox