comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Warning: Religious naming convention discussion :-) [was: assign help!!]
Date: 1997/05/11
Date: 1997-05-11T00:00:00+00:00	[thread overview]
Message-ID: <EA1I8o.HBD@world.std.com> (raw)
In-Reply-To: dewar.863365392@merv


In article <dewar.863365392@merv>, Robert Dewar <dewar@merv.cs.nyu.edu> wrote:
>Bad suggestion. Access types are NOT pointers. They may be implemented using
>pointers some of the time (but not all the time -- we often find people
>using GNAT being surprised to find that access types are not always
>represented using simple pointers in some cases, but of course there is
>nothing in the language that suggests or requires that access types be
>implemented using pointers).

I disagree.  I think "pointer" means "thing that can point".  I don't
think it's a low-level machine-oriented concept at all.  I use the term
"address" or "machine address" for the low-level notion.  I would amend
your last sentence to say, "... there is nothing in the language that
suggests or requires that access types be implemented as machine
addresses."

Note that Pascal calls them "pointers", not "access types", and there is
nothing in Pascal that suggests or requires pointers to be implemented
as machine addresses.  This is even true of C, and there are in fact
implementations of C that implement "foo*" as something other than an
address -- for the purpose of doing bounds checking and whatnot, which
is very expensive in C, but nonetheless useful for debugging.

If I have a private type whose full type is some sort of index into a
table, then I'm perfectly happy to call that a "pointer", even though
it's not implemented as an address, and it's not even implemented as an
access type.

People talk about Lisp/Smalltalk/etc as languages in which "everything's
a pointer", which is an informal phrase intended to mean that all the
variables and whatnot have reference semantics -- not that they're all
implemented as machine addresses (which they might be, but that's
irrelevant).

So, no, I don't think that "pointer" universally means "address".  It
does only in the minds of some people who have only been exposed to
languages that allow or encourage address arithmetic on something called
"pointers".  If people with that background learn a higher-level
language, they simply have to learn that access types, or reference
types, or pointer types, simply aren't addresses.

Analogy: You might say that some programmers assume that "procedure
calls" involve a call instruction at the machine level.  Therefore, we
shouldn't call them "procedure calls" in Ada, because compilers might do
inlining (either in response to pragma Inline, or automatically), and
using the term "call" therefore confuses.

>Suffixing access types with _Pointer emphasizes the confusion, and seems
>inappropriate to me. It is analogous to saying that all integer types
>should be suffixed with
>
>  _Twos_Complement_Bit_String
>
>or somesuch. Names should be chosen to emphasize the meaning at an
>appropriate level of abstraction, not the low-level implementation
>dependent representation.

I don't buy the analogy here.  Two's complement bit-string *is* a
low-level machine-oriented notion.  Address is.  But Pointer is not, at
least for a substantial portion of the software industry.

- Bob




  parent reply	other threads:[~1997-05-11  0:00 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-05  0:00 assign help!! Ivan Gou
1997-05-06  0:00 ` Michael F Brenner
1997-05-07  0:00   ` Charles H. Sampson
1997-05-08  0:00     ` Warning: Religious naming convention discussion :-) [was: assign help!!] John G. Volan
1997-05-09  0:00       ` Kevin Cline
1997-05-09  0:00         ` John G. Volan
1997-05-09  0:00       ` Jay Martin
1997-05-09  0:00         ` Jeff Carter
1997-05-09  0:00           ` John G. Volan
1997-05-10  0:00             ` Aaron Metzger
1997-05-11  0:00               ` Simon Wright
1997-05-11  0:00               ` Robert Dewar
1997-05-11  0:00                 ` John G. Volan
1997-05-11  0:00                 ` Robert A Duff [this message]
1997-05-12  0:00                   ` Robert Dewar
1997-05-12  0:00                     ` Robert A Duff
1997-05-12  0:00                       ` Robert Dewar
1997-05-13  0:00                         ` David L Brown
1997-05-13  0:00                           ` W. Wesley Groleau (Wes)
1997-05-14  0:00                           ` Robert Dewar
1997-05-13  0:00                         ` Robert A Duff
1997-05-13  0:00                           ` Kaz Kylheku
1997-05-14  0:00                             ` Kevin Cline
1997-05-14  0:00                               ` Robert Dewar
1997-05-14  0:00                             ` Robert A Duff
1997-05-13  0:00                           ` Robert Dewar
1997-05-14  0:00                             ` Ole-Hjalmar Kristensen FOU.TD/DELAB
1997-05-12  0:00                 ` Kaz Kylheku
1997-05-12  0:00               ` John G. Volan
1997-05-10  0:00             ` Kaz Kylheku
1997-05-10  0:00               ` John G. Volan
1997-05-10  0:00             ` Robert Dewar
1997-05-10  0:00               ` John G. Volan
1997-05-11  0:00                 ` Robert Dewar
1997-05-12  0:00                   ` Robert I. Eachus
1997-05-13  0:00                     ` Robert Dewar
1997-05-16  0:00                       ` Robert I. Eachus
1997-05-17  0:00                         ` Robert Dewar
1997-05-13  0:00                     ` John G. Volan
1997-05-12  0:00                   ` John G. Volan
1997-05-11  0:00               ` Kevin Cline
1997-05-11  0:00                 ` Robert Dewar
1997-05-12  0:00                   ` John G. Volan
1997-05-12  0:00                     ` Robert Dewar
1997-05-16  0:00                 ` Wayne Magor
1997-05-16  0:00                   ` John G. Volan
1997-05-16  0:00                   ` Robert Dewar
1997-05-18  0:00                     ` Nick Roberts
1997-05-20  0:00                     ` naming convention discussion Peter Hermann
1997-05-14  0:00               ` Warning: Religious naming convention discussion :-) [was: assign help!!] Ben Brosgol
1997-05-14  0:00                 ` naming convention: trailing underscore Peter Hermann
1997-05-14  0:00                   ` John G. Volan
1997-05-15  0:00                   ` Michael F Brenner
     [not found]                 ` <dewar.863717431@merv>
1997-05-16  0:00                   ` naming convention discussion Peter Hermann
1997-05-16  0:00                     ` Robert Dewar
1997-05-20  0:00                       ` Peter Hermann
1997-05-16  0:00                   ` Warning: Religious naming convention discussion :-) [was: assign help!!] Robert A Duff
1997-05-18  0:00                     ` Underscores in identifiers (was: Warning: Religious naming convention discussion :-) Ben Brosgol
1997-05-17  0:00                   ` Warning: Religious naming convention discussion :-) [was: assign help!!] Arthur Schwarz
1997-05-17  0:00                     ` Robert Dewar
1997-05-17  0:00                       ` John G. Volan
1997-05-18  0:00                         ` Andrew Dunstan
1997-05-18  0:00                           ` Nick Roberts
1997-05-19  0:00                             ` John G. Volan
1997-05-19  0:00                             ` John G. Volan
1997-05-12  0:00             ` Jeff Carter
1997-05-12  0:00               ` John G. Volan
1997-05-12  0:00             ` W. Wesley Groleau (Wes)
1997-05-12  0:00               ` John G. Volan
1997-05-13  0:00                 ` W. Wesley Groleau (Wes)
1997-05-13  0:00                   ` John G. Volan
1997-05-14  0:00                     ` naming convention discussion Peter Hermann
1997-05-14  0:00                       ` John G. Volan
1997-05-14  0:00                         ` Peter Hermann
1997-05-14  0:00                           ` John G. Volan
1997-05-15  0:00                             ` Peter Hermann
1997-05-15  0:00                           ` W. Wesley Groleau (Wes)
1997-05-14  0:00                     ` Warning: Religious naming convention discussion :-) [was: assign help!!] Do-While Jones
1997-05-14  0:00                       ` Stephen Leake
1997-05-14  0:00                       ` John G. Volan
1997-05-14  0:00                         ` John G. Volan
1997-05-15  0:00                         ` Tangent to Religious naming convention discussion W. Wesley Groleau (Wes)
1997-05-15  0:00                           ` John G. Volan
1997-05-09  0:00           ` Warning: Religious naming convention discussion :-) [was: assign help!!] John G. Volan
1997-05-10  0:00           ` Robert Dewar
1997-05-10  0:00             ` John G. Volan
1997-05-11  0:00               ` Robert Dewar
1997-05-12  0:00                 ` John G. Volan
1997-05-12  0:00               ` W. Wesley Groleau (Wes)
1997-05-12  0:00             ` W. Wesley Groleau (Wes)
1997-05-12  0:00               ` John G. Volan
1997-05-11  0:00           ` Doug Smith
1997-05-12  0:00           ` Tom Moran
1997-05-16  0:00           ` Wayne Magor
1997-05-16  0:00             ` John G. Volan
1997-05-17  0:00             ` Kevin Cline
1997-05-19  0:00               ` Doug Smith
1997-05-09  0:00         ` John G. Volan
1997-05-12  0:00       ` W. Wesley Groleau (Wes)
1997-05-12  0:00         ` John G. Volan
1997-05-12  0:00         ` John G. Volan
1997-05-10  0:00     ` assign help!! Simon Wright
1997-05-14  0:00       ` Nick Roberts
replies disabled

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