comp.lang.ada
 help / color / mirror / Atom feed
From: mfb@mbunix.mitre.org (Michael F Brenner)
Subject: Re: Future Ada language revisions?
Date: 1998/09/29
Date: 1998-09-29T00:00:00+00:00	[thread overview]
Message-ID: <6uqjh3$nbg@top.mitre.org> (raw)
In-Reply-To: Pine.BSF.4.02A.9809282138540.20653-100000@shell5.ba.best.com

On the topic of IN OUT parameters for Ada functions:
  > We all lack perspective, and I probably lack more than most. However, when
  > I find myself using access parameters (and then aliased variables :-) to
  > work around this restriction, I'm forced to ask myself if the cure isn't
  > worse than the disease (side effecting functions).

Using pointers and the Ada ALIASED keyword is only one way to alias variables.

However, IN OUT parameters have the same coupling effect (to alias
the variables through the parameter passing interface). The verb to alias
means to permit changes in one variable to effect the value of another.

Aliasing of any kind (including homonyms) encourages programmers to
insert bugs in their code and then provides a path in the variable 
name space through which those bugs can propogate to other parts of the
code.
 
We should therefore become more aware of what language features
cause aliasing to occur in address space or in name space, because
of the software maintenance implications of this aliasing (that is,
because aliasing provides bug propogation paths). To become more
aware, here is a list of the Ada constructs (other than ALIASED) which
provide a form of aliasing:
    overloaded variables such as RENAMES or equivalences or commons
    homonyms such as overloaded enumeration elements or array elements
    polymorphism or objects with changeable discriminants or tags
    external objects shared with other languages (e.g. pragma INTERFACE)
    parameters passed by reference (such as IN OUT)
    unchecked_conversion
    pointers or access type variables
    forcing the use of access variables to get things off the stack
    non-limited-private types
    re-use of variables for multiple assignments
    use of protocols like temporary variables or intermediate files
    non-limited-private-types

Mike Brenner   mikeb@mitre.org




  reply	other threads:[~1998-09-29  0:00 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-27  0:00 Future Ada language revisions? bpr5549
1998-09-27  0:00 ` Larry Kilgallen
1998-09-27  0:00   ` Brian Rogoff
1998-09-28  0:00     ` dewarr
1998-09-28  0:00       ` Brian Rogoff
1998-09-29  0:00         ` Michael F Brenner [this message]
1998-10-02  0:00           ` Fergus Henderson
1998-09-29  0:00         ` Larry Kilgallen
1998-09-28  0:00     ` Michael F Brenner
1998-09-28  0:00       ` dewarr
1998-09-28  0:00   ` Arthur Evans Jr
1998-09-28  0:00     ` dewarr
1998-09-28  0:00 ` dewar
1998-10-05  0:00   ` Alfred Hilscher
1998-10-05  0:00     ` dewarr
1998-10-06  0:00       ` Alfred Hilscher
1998-10-05  0:00     ` Brian Rogoff
1998-10-05  0:00       ` dewarr
1998-10-05  0:00     ` Tucker Taft
1998-10-02  0:00 ` Robert I. Eachus
1998-10-03  0:00   ` Brian Rogoff
1998-10-05  0:00     ` dewarr
1998-10-04  0:00       ` Brian Rogoff
1998-10-05  0:00         ` Martin Dowie
1998-10-05  0:00           ` Niklas Holsti
1998-10-05  0:00             ` Martin Dowie
1998-10-05  0:00           ` dewarr
1998-10-06  0:00           ` dennison
1998-10-06  0:00             ` dewarr
1998-10-06  0:00               ` Martin Dowie
1998-10-06  0:00             ` Martin Dowie
1998-10-06  0:00           ` dennison
1998-10-06  0:00           ` r_barton1
1998-10-06  0:00         ` Matthew Heaney
1998-10-06  0:00     ` Robert I. Eachus
1998-10-06  0:00       ` Brian Rogoff
1998-10-07  0:00       ` dewarr
     [not found] ` <tgmF02yDo.A84@netcom.com>
1998-10-06  0:00   ` Matthew Heaney
1998-10-08  0:00 ` dennison
1998-10-08  0:00   ` Pat Rogers
1998-10-08  0:00   ` Brian Rogoff
1998-10-09  0:00     ` dennison
1998-10-16  0:00   ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1998-10-21  0:00 Van Snyder
1998-10-22  0:00 ` Robert A Duff
1998-10-21  0:00   ` Brian Rogoff
1998-10-23  0:00     ` Robert I. Eachus
1998-10-29  0:00     ` Robert A Duff
1998-10-30  0:00       ` Brian Rogoff
replies disabled

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