comp.lang.ada
 help / color / mirror / Atom feed
From: drm1@vrdxhq.UUCP (Donn Milton)
Subject: Procedure Parameters in Ada
Date: Wed, 4-Jun-86 18:09:02 EDT	[thread overview]
Date: Wed Jun  4 18:09:02 1986
Message-ID: <8606042209.AA23350@vrdxhq.uucp> (raw)


Many people seem to be unaware of a major problem entailed by
procedures as parameters.  That is, when procedures are allowed
as parameters, strong type-checking becomes generally undecidable
(not just hard) UNLESS recursive mode-type declarations (a la Algol 68)
are introduced.  For example, in languages like Fortran, Algol 60,
PL/1, and C, strong type-checking cannot be done.  This was proved
formally by Langmaack in "On Correct Procedure Parameter
Transmission in Higher Programming Languages," Acta Informatica,
Vol. 2, 1973, pp. 110-142.

With the declaration mechanism available in Algol 68, it is possible
to declare "a procedure that has two parameters: an integer and a
procedure that has two parameters: an integer and a procedure that
has two parameters ..." ad infinitum, which is required for strong
type-checking of procedure parameters.  Understand that
type equivalence in Algol 68 means structural equivalence,
while type equivalence in Ada means name equivalence -- thus
type-checking is much simpler in Ada.

However, I do not understand why such a declaration mechanism, which
would allow procedures as parameters with strong type-checking,
was not included in Ada.  Algol 68 had demonstrated its
feasibility (with some elegance), and, as far as I know,
this capability is not a source of significant compile-time
or run-time inefficiencies.

Donn Milton

             reply	other threads:[~1986-06-04 22:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-06-04 22:09 Donn Milton [this message]
1986-06-08 19:11 ` Procedure Parameters in Ada aglew
1986-06-09 17:55 ` Chris Henrich
1986-06-10 20:22   ` Jerry Sweet
1986-06-13 20:31     ` wf
1986-06-13 20:58   ` Theodore S
  -- strict thread matches above, loose matches on Subject: below --
1986-06-09 16:39 Donn Milton
1986-06-11 16:01 Donn Milton
replies disabled

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