comp.lang.ada
 help / color / mirror / Atom feed
From: mph@lion.inmos.co.uk (Mike Harrison)
Subject: Re: Ada functions versus arrays (i.e. () vs [] )
Date: 2 Mar 90 10:56:48 GMT	[thread overview]
Message-ID: <4319@ganymede.inmos.co.uk> (raw)
In-Reply-To: 6281@bd.sei.cmu.edu

In article <6281@bd.sei.cmu.edu> firth@sei.cmu.edu (Robert Firth) writes:

>As a second example, consider a dictionary used by a spelling checker.
>There is a function Check(W) that checks whether W is in the dictionary.
>Many implementations of this function are adaptive: they use a temporary
>cache of some kind that is dynamically reorganised so that words
>occurring frequently in the document in question float to the front.
>Over a long document, this can substantially speed the checking process.
>Again, this is a benign and proper use of side effects within a function.

I question whether this is really a side-effect.
Clearly it is a side-effect at the level of the implementation, in that it
causes a change of state from a call of the function, but if you view the 
function as a mapping from elements of its domain to elements of its range
then there is no observable change at the appropriate level of abstraction.

This is not a disagreement with Robert's point, because the Ada code of the 
function body will clearly cause side-effects.
It is rather an attempt to point out that 'pernicious' side-effects are those
which are visible at the same level of abstraction as the function definition,
rather than its implementation.

The problem is writing a compiler which can recognise the distinction.

Mike,




Michael P. Harrison - Software Group - Inmos Ltd. UK.
-----------------------------------------------------------
UK : mph@inmos.co.uk             with STANDARD_DISCLAIMERS;
US : mph@inmos.com               use  STANDARD_DISCLAIMERS;

  reply	other threads:[~1990-03-02 10:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-02-20 16:13 Reasons for dropping Ada Ted Holden
1990-02-20 21:04 ` Richard S D'Ippolito
1990-02-20 23:03   ` Reasons for keeping Ada David Kassover
1990-02-21  0:40     ` Clement Pellerin
1990-02-21 19:02   ` Reasons for dropping Ada Loren Louis Hart
1990-02-22 16:07     ` Mike Coffin
1990-02-22 17:01       ` if UNIX then USE_C ?? (was: Reasons for drop) Dennis M. O'Connor
1990-02-22 21:51         ` Barry Margolin
1990-02-23 19:34           ` Loren Louis Hart
1990-02-25 19:58           ` David Kassover
1990-02-26 12:45             ` John F Nixon
1990-02-26 18:28               ` David Kassover
1990-02-26 20:55                 ` John F Nixon
1990-02-26 22:00                   ` David Kassover
1990-02-27 18:55                 ` Jeremy Epstein
1990-02-28  1:19                   ` Alex Blakemore
1990-02-28 18:56                     ` Ada functions versus arrays (i.e. () vs [] ) Richard A Hammond
1990-03-01  3:25                       ` Alex Blakemore
1990-03-01 13:11                         ` Robert Firth
1990-03-02 10:56                           ` Mike Harrison [this message]
1990-03-02 23:46                           ` Scott Simpson
1990-03-02 10:42                         ` Mike Harrison
1990-03-06 19:13                       ` Erland Sommarskog
1990-03-08 14:21                         ` John Goodenough
1990-03-14 18:19                     ` if UNIX then USE_C ?? (was: Reasons for drop) RCAPENER
1990-03-01  0:29                   ` David Kassover
1990-03-01 15:11                     ` Steve Tynor
1990-03-01 18:29                       ` David Kassover
1990-03-02  0:19                 ` Robert D. Houk
1990-02-28 19:51         ` Andy DeFaria
1990-02-20 22:21 ` Reasons for dropping Ada Jeffrey M. Schweiger
replies disabled

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