comp.lang.ada
 help / color / mirror / Atom feed
From: "news.oxy.com" <Vladimir_Olensky@oxy.com>
Subject: Re: Dynamicly declaring arrays (was: Time to join the fold?)
Date: 1999/02/02
Date: 1999-02-02T00:00:00+00:00	[thread overview]
Message-ID: <7973lb$mdl$1@remarQ.com> (raw)
In-Reply-To: 7963q0$ail$1@nnrp1.dejanews.com


robert_dewar@my-dejanews.com wrote in message
<7963q0$ail$1@nnrp1.dejanews.com>...
>In article <794gg7$ib$1@nnrp1.dejanews.com>,
>  dennison@telepath.com wrote:
>> I'm not entirely sure I can defend this aversion to
>> declare blocks in a rational way, so if anyone has a
>> rationale as to why its perfecly acceptable to have
>> declare blocks liberally sprinkled throught their code,
>> I'm all ears.
>
>Why on earth does it need a rationale to use a feature
>in the language that is obviously useful and has an ancient
>and well accepted understanding as useful (blocks were
>after all in Algol-60).
>
>THe principle of using blcoks to make temporaries as
>local as possible is of course familiar to any programmer
>in an algol style language.


I could also mention that this was also used  in   Modula-2 as well (inner
modules).
Modula-2 had many features that later was implemented in Ada.
E.g. module in Modula-2 corresponds to package in Ada, IMPORT clause in
Modula-2 corresponds to WITH clause in Ada ,concept of "safe&reliable"
programming, concept of hiding implementation details using module
specifications  e.t.c.

Ability to reduce the living scope and name scope  of any king of objects
within large program can significantly increase the reliability of the
program.

Local blocks are especially useful in conjunction with some of other
powerful Ada features and give you ability
 1. To use  USE  and/or  USE TYPE clauses within declaration block so you do
not need to type fully qualified names and at the same time there is no
possibility of names clashes within program scope
 2. To locally  rename long packages and function names and create local
instances of  generic packages.
   2.1. both  1 &2  greatly increase readability of the program and show
programmer intentions.
 3. To declare local objects that should  be deleted on exit of the block
scope.
     This is very useful in conjunction with the use of controlled types
that is used to implement some kind of user defined garbage collection;
 4.  To define  local exception handlers  within block.

This list is not full. It is just short outline.
The real feeling of all that things will come with time and experience.

Regards,
Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.







  reply	other threads:[~1999-02-02  0:00 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-22  0:00 Time to join the fold? Mike Silva
1999-01-22  0:00 ` Tucker Taft
1999-01-25  0:00   ` Mike Silva
1999-01-25  0:00     ` dennison
1999-01-31  0:00       ` Matthew Heaney
1999-02-01  0:00         ` Dynamicly declaring arrays (was: Time to join the fold?) dennison
1999-02-01  0:00           ` Matthew Heaney
1999-02-01  0:00           ` Larry Kilgallen
1999-02-02  0:00           ` robert_dewar
1999-02-02  0:00             ` news.oxy.com [this message]
1999-02-02  0:00               ` dennison
1999-02-02  0:00               ` robert_dewar
1999-02-03  0:00                 ` news.oxy.com
1999-02-03  0:00                   ` Robert I. Eachus
1999-02-04  0:00                   ` M2 history - relations to Ada news.oxy.com
1999-02-04  0:00                     ` Chuck Clark
1999-02-10  0:00                       ` Andreas Borchert
1999-02-04  0:00                     ` David C. Hoos, Sr.
1999-02-04  0:00                       ` news.oxy.com
1999-02-04  0:00                         ` G.S. Vigneault
1999-02-04  0:00                         ` Jean-Pierre Rosen
1999-02-04  0:00                       ` Chris Morgan
1999-02-04  0:00                         ` Jerry van Dijk
1999-02-05  0:00                         ` Grant Edwards
1999-02-04  0:00                       ` Aron Felix Gurski
1999-02-05  0:00                         ` Robert Lanziner-Furtenbach
1999-02-04  0:00                           ` David C. Hoos, Sr.
1999-02-05  0:00                           ` Robert Lanziner-Furtenbach
1999-02-04  0:00                     ` robert_dewar
1999-02-02  0:00               ` Dynamicly declaring arrays (was: Time to join the fold?) nabbasi
1999-02-02  0:00                 ` dennison
1999-02-02  0:00                   ` robert_dewar
1999-02-02  0:00                     ` Al Christians
1999-02-02  0:00                     ` William Clodius
1999-02-03  0:00                       ` Robert A Duff
1999-02-03  0:00                         ` Modula 2 William Clodius
1999-02-02  0:00                     ` Dynamicly declaring arrays (was: Time to join the fold?) dennison
1999-01-25  0:00     ` Time to join the fold? robert_dewar
1999-02-02  0:00       ` news.oxy.com
1999-01-25  0:00     ` Pat Rogers
1999-01-26  0:00     ` Jean-Pierre Rosen
1999-01-26  0:00       ` dennison
1999-01-26  0:00         ` Pascal MALAISE
1999-01-27  0:00     ` Steve Whalen
1999-02-01  0:00       ` Robert I. Eachus
1999-01-23  0:00 ` Matthew Heaney
1999-01-23  0:00   ` Tom Moran
1999-01-23  0:00 ` Steve Whalen
1999-01-23  0:00   ` Tom Moran
1999-01-24  0:00     ` Steve Whalen
1999-01-24  0:00       ` Tom Moran
1999-01-24  0:00 ` Larry Kilgallen
replies disabled

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