comp.lang.ada
 help / color / mirror / Atom feed
From: broman@noscvax.UUCP (Vincent P. Broman)
Subject: Re: ForTran-Ada + flamette + question
Date: Fri, 30-May-86 12:28:43 EDT	[thread overview]
Date: Fri May 30 12:28:43 1986
Message-ID: <503@noscvax.UUCP> (raw)
In-Reply-To: 4700037@ada-uts

<>

richw@ada-uts justifies the lack of procedure pointers in ada by
asserting that they can be simulated satisfactorily with an 'eval'
procedure, that dispatches on a parameter of an enumerated type by
invoking the procedure that is logically associated with the
parameter's value.

This is insufficient. The canonical example is a numerical quadrature
package which integrates user-supplied functions.  The problem is that
the dispatcher that repeatedly invokes the integrand must know the NAMES
of all potential integrands in order to invoke them.  These names are
known only at user-compile-time, not library-compile-time.
The quadrature routine should not see integrand names, it should only
specify the parameter and result types of the eventual integrands.

A generic quadrature package mispleases because separate copies of
it must be instantiated for each function to be integrated.

I have used function/procedure pointers in Algol-family languages
fairly often.  A big attraction (to me :-) of Scheme and its cousins is
the power afforded by making procedures first-class objects.  If
language size is the real concern here, I would gladly give up in
return such dubious features of ada as: default values of parameters,
the raise statement, assignments to objects of unconstrained size,
etc.


Vincent Broman, code 632,  Naval Ocean Systems Center, San Diego, CA 92152, USA
Phone: +1 619 225 2365        {seismo,caip,ihnp4,ucbvax}!\\\\\\\
Arpa: broman@bugs.nosc.mil Uucp: {floyd,moss,bang,hp-sdd,sdcsvax}!noscvax!broman

  reply	other threads:[~1986-05-30 16:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-05-28 16:56 ForTran-Ada + flamette + question richw
1986-05-30 16:28 ` Vincent P. Broman [this message]
1986-06-02 16:28   ` Jonathan P. Biggar
1986-06-03  5:11     ` Barry Margolin
1986-06-03 12:39     ` Russ Holden
1986-06-04 23:39   ` Bryce Bardin
  -- strict thread matches above, loose matches on Subject: below --
1986-05-28 15:54 richw
1986-05-30 12:46 ` Russ Holden
     [not found] <175155@QZCOM>
1986-05-22  1:00 ` Jan_Michael_Rynning
1986-05-21  6:06 larry
1986-05-21 15:41 ` Mark Biggar
1986-05-21 16:40 ` broman
1986-05-28 19:30 ` David Lamb
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox