comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Function Calls by Address
Date: 1999/09/03
Date: 1999-09-03T00:00:00+00:00	[thread overview]
Message-ID: <7qp8sd$u8i$1@nnrp1.deja.com> (raw)
In-Reply-To: 37CFFEA6.921CBE59@magic.fr

In article <37CFFEA6.921CBE59@magic.fr>,
  Francois Godme <fgodme@magic.fr> wrote:
> I knew about the nested procedures restriction but thought
> that no one still uses nested procedures.

An amazingly narrow thought. It is true that people who don't
have them (who use languages starting with the letter C) don't
use them, but then COBOL programmers don't use dynamic
allocation :-)

> Personally, I have  stopped using them. Wh will I hide a
> perfectly useful procedure inside another when all I want
> is to spare me rewriting over and over the same thing.

If you think this is all procedures are good for, you are
missing a lot! I usually tell my students that if they see
a large program which does NOT have cases of procedures that
are called only once, it is likely that the design is
incompetent!

> Are nested
> procedures coming from the Pascal heritage where everything
> was residing
> inside the main program?

No, not at all, and if you ask the question, then it means,
as above, that you are missing a lot!

Nested procedures are used when solution of a problem requires
functional decomposition on a local level, and the resulting
procedures that come from that functional decomposition are
relevant only locally, so you do not want to pollute name
spaces. Furthermore, non-local references are a powerful
mechanism for many purposes.

In particular, the lack of thread safety of many run-time
routines in the C library can be ascribed to the excessive use
of global variables that would much better be local variables
referenced non-locally where necessary.

Nested procedures are a very powerful feature of Ada. If you
have stopped using them, you probably never fully understood
how to make good use of this feature.

> By the same matter, who is still using the
> 'separate' construct for writing new applications?

Anyone who understands the power of this capability. It is quite
true that Ada 95 replaces SOME of the need for subunits by
child units, but only some.

During the design of the modules extension for Algol-68 (done
by Hendrick Boom, Charles Lindsey, and Robert Dewar) we
furiously tried to unify the notions of top down and bottom
up decomposition, and finally decided that it was simply not
cleanly possible. That is why the final proposal includes two
separate but related facility.

This is one area where the Ada design drew directly from
the Algol-68 work, so in some sense this Algol-68 design
was the genesis for the subunit notion.

If you never use subunits, then again, you probably have not
fully understood the power of this feature.

Not everyone has to use everything, and indeed it is often the
case that you simply don't learn everything, and manage to live
without things you have not learned.

But don't make the jump of thinking that because you don't see
that particular features are useful, they must be useless. It
is more likely that you are missing something. There was a
pretty fierce attempt to remove all useless features from
both Ada 83 and Ada 95, so if something exists in the design,
it means there was a strong constituency with good arguments for
its inclusion. So if you don't know any good arguments in favor
of a given feature, it does not mean they don't exist, it just
means you are not familiar enough with the particular feature.

Robert Dewar


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  parent reply	other threads:[~1999-09-03  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30  0:00 Function Calls by Address Craig Jameson
1999-08-30  0:00 ` Robert Dewar
1999-08-30  0:00 ` Robert Dewar
1999-08-31  0:00   ` Martin Gangkofer
1999-08-30  0:00 ` Marin David Condic
1999-08-30  0:00   ` Marin David Condic
1999-08-30  0:00     ` Larry Kilgallen
1999-08-30  0:00   ` Robert Dewar
1999-08-31  0:00 ` David Kristola
1999-08-31  0:00 ` Matthew Heaney
1999-09-01  0:00 ` Simon Wright
1999-09-02  0:00 ` Francois Godme
1999-09-03  0:00   ` Robert Dewar
1999-09-03  0:00     ` Francois Godme
1999-09-03  0:00       ` Marin David Condic
1999-09-14  0:00         ` Robert I. Eachus
     [not found]           ` <wcc3dwgb7ii.fsf@world.std.com>
     [not found]             ` <37E81079.CC2566D9@mitre.org>
1999-09-22  0:00               ` Robert A Duff
1999-09-22  0:00                 ` Robert I. Eachus
1999-09-23  0:00                 ` Robert Dewar
1999-09-23  0:00                   ` Robert A Duff
1999-09-03  0:00       ` David C. Hoos, Sr.
1999-09-04  0:00         ` Robert Dewar
1999-09-05  0:00           ` Francois Godme
1999-09-06  0:00             ` Robert Dewar
1999-09-06  0:00               ` Francois Godme
1999-09-06  0:00                 ` Robert Dewar
1999-09-06  0:00                   ` Bob Collins
1999-09-07  0:00                     ` Pascal Obry
1999-09-06  0:00                 ` Robert Dewar
1999-09-07  0:00                 ` Pascal Obry
1999-09-07  0:00                   ` Francois Godme
1999-09-08  0:00                   ` Francois Godme
1999-09-03  0:00       ` Simon Wright
1999-09-03  0:00       ` Robert Dewar [this message]
1999-09-03  0:00         ` Ted Dennison
1999-09-04  0:00           ` Jean-Pierre Rosen
1999-09-05  0:00             ` Matthew Heaney
1999-09-05  0:00             ` Ehud Lamm
1999-09-04  0:00         ` Brian Rogoff
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-04  0:00       ` Mario Klebsch
1999-09-05  0:00         ` Robert Dewar
1999-09-06  0:00           ` Francois Godme
1999-09-05  0:00             ` Brian Rogoff
1999-09-06  0:00             ` Robert Dewar
1999-09-08  0:00               ` Georg Bauhaus
1999-09-05  0:00       ` Geoff Bull
1999-09-07  0:00       ` Michael F. Yoder
replies disabled

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