From: scott@shuksan.UUCP (Scott Moody)
Subject: Re: Procedure types and dynamic binding
Date: 14 Jan 89 00:46:50 GMT [thread overview]
Message-ID: <1089@shuksan.UUCP> (raw)
In-Reply-To: 8178@aw.sei.cmu.edu
>
> > I haven't done an extended investigation of the literature, but
> > procedural variables in Algol-family languages would appear to
> > be a research topic
> <code not included>
>
> The final statement invokes the value of procvar, which is, of course,
> "inner". The call of inner references the variable X declared in outer,
> which no longer exists. This is the equivalent of the "dangling reference"
> problem when the address of a local variable is assigned to a global
> pointer.
>
The C language solves this problem by not allowing 'inner' procedures at all.
Of course in C any address could be used and called, but it might not
point to anything meaningful.
I would thing the bigger problems with procedure parameters is in the
parameters to those procedures; especially in Ada where there might be
overloaded procedures with very complex arguments. The syntax for
specifying - and then checking at runtime that the user supplies
the arguments correctly can get very complex.
I think Ada's solution of requiring procedures to be supplied
to generics is a good compromise between allowing a users code to suddenly
jump to somewhere (hopefully not hitting any stars), and not having
them at all. I for one wouldn't mind procedure parameters and varaiables,
ala C, but I can see that they go against the non goto rational behind Ada.
-- scott
next prev parent reply other threads:[~1989-01-14 0:46 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
1988-12-30 21:42 Procedure types and dynamic binding Erland Sommarskog
1988-12-31 17:46 ` Bob Hathaway
1989-01-05 10:02 ` William Thomas Wolfe,2847,
1989-01-07 18:05 ` Bob Hathaway
1989-01-07 21:21 ` William Thomas Wolfe,2847,
1989-01-08 1:49 ` Bob Hathaway
1989-01-08 19:01 ` William Thomas Wolfe,2847,
1989-01-08 23:10 ` Bob Hathaway
1989-01-09 1:47 ` William Thomas Wolfe,2847,
1989-01-09 20:19 ` Bob Hathaway
1989-01-10 3:01 ` William Thomas Wolfe,2847,
1989-01-10 3:06 ` Bob Hathaway
1989-01-10 19:11 ` William Thomas Wolfe,2847,
1989-01-11 2:08 ` Bob Hathaway
1989-01-11 14:24 ` William Thomas Wolfe,2847,
1989-01-11 17:51 ` Barry Margolin
1989-01-11 22:54 ` William Thomas Wolfe,2847,
1989-01-12 13:57 ` Robert Firth
1989-01-12 19:09 ` William Thomas Wolfe,2847,
1989-01-14 0:46 ` Scott Moody [this message]
1989-01-15 18:28 ` William Thomas Wolfe,2847,
1989-01-24 4:07 ` Paul Stachour
1989-01-12 0:58 ` William Thomas Wolfe,2847,
1989-01-12 6:12 ` Barry Margolin
1989-01-11 14:48 ` Submitting Ada 9X revision requests William Thomas Wolfe,2847,
1989-01-11 2:10 ` Procedure types and dynamic binding Bob Hathaway
1989-01-05 7:38 ` William Thomas Wolfe,2847,
-- strict thread matches above, loose matches on Subject: below --
1989-01-06 23:04 Erland Sommarskog
1989-01-07 22:20 ` William Thomas Wolfe,2847,
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox