comp.lang.ada
 help / color / mirror / Atom feed
From: Paul Duquennoy <paul.duquennoy@wanadoo.fr>
Subject: Re: Question for the folks who designed Ad
Date: 1999/04/29
Date: 1999-04-29T06:37:54+00:00	[thread overview]
Message-ID: <3727FEB6.6ECEB1F5@wanadoo.fr> (raw)
In-Reply-To: 7g8roe$igd1@svlss.lmms.lmco.com

David Kristola wrote:
> 
> In article hjh3@ftp.kvaerner.com, "Tarjei Tj�stheim Jensen" <tarjei.jensen@kvaerner.no> () writes:
> >
> >Robert Dewar wrote :
> >>
> >>In other words:
> >>
> >>  a(5)
> >>
> >>is a reference to a mapping, and you want the range value
> >>given the domain value 5. Whether this is implemented by
> >>an array or a function is an implementation detail that
> >>should not affect the syntactic form of reference.
> >
> >
> >What would a(5) := 4; mean then? You cannot assign to a function as far as I
> >know. Which in my opinion voids the function opposition to the common
> >convention of using square brackets for array indices.
> >
> >I don't mind if the function addicts still writes a(5) := 4, if I can write
> >a[5] := 4.
> >
> >Greetings,
> >
> >
> >
> 
> a(5).some_value := 4;
> 
> Maybe the function a returns a pointer to a record structure...
> 

Absolutely, and this is useful. An early version of a package can use an array 
to implement a feature, but later it can be changed to a more sophisticated
approach 
using a cache (e.g. if there are too many unused entries in the array) without
disturbing the existing code.

It is then clear that the 'a(5)' is a way to access some data, regardless of
its 
implementation. Ada allows very minimal impact on the code in such circumstances.

The 'auto-dereferencing' of pointers in Ada (vs '->' in C) also gives more flexibility
to change the implementation from actual data to accesses and vice-versa.




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

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-26  0:00 Question for the folks who designed Ada95 Corey Ashford
1999-04-27  0:00 ` Matthew Heaney
1999-04-27  0:00   ` Matthew Heaney
1999-04-27  0:00   ` Corey Ashford
1999-04-28  0:00     ` Marin David Condic
1999-04-28  0:00     ` Robert A Duff
1999-04-28  0:00       ` Keith Thompson
1999-04-29  0:00         ` Robert A Duff
1999-04-27  0:00 ` Robert Dewar
1999-04-27  0:00   ` Corey Ashford
1999-04-27  0:00   ` Tarjei Tj�stheim Jensen
1999-04-27  0:00     ` Larry Kilgallen
1999-04-27  0:00     ` David Starner
1999-04-27  0:00       ` Robert Dewar
1999-04-27  0:00         ` David Starner
1999-04-28  0:00           ` Samuel Mize
1999-04-28  0:00           ` Robert Dewar
1999-04-28  0:00         ` Tarjei Tj�stheim Jensen
1999-04-28  0:00           ` dennison
1999-04-28  0:00             ` Robert Dewar
1999-04-28  0:00               ` Robert A Duff
1999-04-28  0:00                 ` Brian Hanson
1999-04-28  0:00                   ` bill
1999-04-29  0:00                     ` Robert S. White
1999-04-29  0:00                       ` Robert Dewar
1999-04-30  0:00                         ` Robert S. White
1999-04-29  0:00                       ` Robert Dewar
1999-04-30  0:00                         ` Robert S. White
1999-04-30  0:00                           ` dennison
1999-04-29  0:00                     ` Robert Dewar
1999-04-28  0:00                       ` Pat Rogers
1999-04-29  0:00                         ` Robert Dewar
1999-04-29  0:00                           ` dennison
1999-04-29  0:00                             ` Pat Rogers
1999-04-30  0:00                 ` Robert Dewar
1999-04-28  0:00           ` Robert Dewar
1999-04-28  0:00             ` Robert A Duff
1999-04-29  0:00             ` Bill Ghrist
1999-04-29  0:00             ` Tarjei Tj�stheim Jensen
1999-04-28  0:00           ` Larry Kilgallen
1999-04-28  0:00           ` Robert A Duff
1999-04-29  0:00           ` Question for the folks who designed Ad David Kristola
1999-04-29  0:00             ` Paul Duquennoy [this message]
1999-04-27  0:00     ` Question for the folks who designed Ada95 Robert Dewar
1999-04-28  0:00       ` Corey Ashford
1999-04-28  0:00         ` Robert Dewar
1999-04-28  0:00           ` Robert A Duff
1999-04-28  0:00             ` Robert Dewar
1999-04-29  0:00               ` Robert A Duff
1999-04-29  0:00           ` Corey Ashford
1999-04-29  0:00             ` Robert Dewar
1999-04-29  0:00               ` Fraser Wilson
1999-04-29  0:00                 ` Marin David Condic
1999-04-29  0:00                 ` Mark A Biggar
1999-04-30  0:00                   ` Tucker Taft
1999-04-29  0:00                 ` Tucker Taft
1999-04-30  0:00                 ` David Brown
1999-04-29  0:00               ` Geert Bosch
1999-04-29  0:00             ` Corey Ashford
1999-04-27  0:00     ` bill
1999-04-27  0:00       ` Robert Dewar
1999-04-27  0:00         ` Al Christians
1999-04-27  0:00           ` Larry Kilgallen
1999-04-27  0:00             ` Al Christians
1999-04-28  0:00         ` Robert A Duff
1999-04-28  0:00           ` Robert Dewar
1999-04-29  0:00             ` Matthew Heaney
1999-04-29  0:00               ` Robert Dewar
1999-04-29  0:00               ` Jean-Pierre Rosen
1999-04-27  0:00       ` dennison
1999-04-27  0:00         ` Robert Dewar
1999-04-29  0:00           ` Robert A Duff
1999-04-29  0:00     ` Aidan Skinner
1999-04-30  0:00       ` Matthew Heaney
1999-04-27  0:00 ` Samuel Mize
1999-04-27  0:00   ` Samuel Mize
1999-04-27  0:00     ` Robert Dewar
1999-04-28  0:00       ` Samuel Mize
1999-04-28  0:00         ` Samuel Mize
1999-04-28  0:00       ` Corey Ashford
1999-04-28  0:00         ` Robert Dewar
1999-04-29  0:00           ` Corey Ashford
1999-04-29  0:00             ` Robert Dewar
1999-04-29  0:00               ` Fraser Wilson
1999-04-29  0:00                 ` Marin David Condic
1999-04-29  0:00                 ` Robert Dewar
1999-04-28  0:00     ` Corey Ashford
1999-04-28  0:00     ` Corey Ashford
replies disabled

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