From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aba9ec8a75fce75a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-11 12:13:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!uunet!ash.uu.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: simple question?! (choice of the name "access type") Date: 11 Jun 2003 15:13:57 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1055358837 4708 199.172.62.241 (11 Jun 2003 19:13:57 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 11 Jun 2003 19:13:57 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:39001 Date: 2003-06-11T15:13:57-04:00 List-Id: Kilgallen@SpamCop.net (Larry Kilgallen) writes: > In article , vashwath@rediffmail.com (prashna) writes: > > Hi all, > > Why access types in Ada are called as access types?What can these > > types access?why not it is called by some other name?Any pointers on > > this will be appreciated. > > The value of an access type can be used to access objects of some > other type (designated when the particular access type was declared). > > The other name which access types might have been called is "pointers", > but they lack many of the aspects (drawbacks) of pointers in other > languages: > > You cannot arbitrarily add to access types as one would > do in C to walk down an array (or walk off the > end of an array). But Ada is descended from Pascal, and you can't do pointer arithmetic in Pascal, either. Yet Pascal calls them "pointers". I think it was silly and obfuscatory for Ada to call them "access types". It also makes talking about them harder: for most types, there's a simple noun you can use to refer to values or objects of the type. If a program says: type T is range 1..10; X: T; you can say "X is an integer". The value of integer types are "integers". But for access types you can't say "X is an access", nor "the value of access types are accesses". (I have the same complaint about protected types -- there's no such thing as a "protected".) IMHO, access types should be called "pointer" or "reference" types. > Implementations are not required to implement access > types as a pointer. I would say, "Implementations are not required to implement access types as machine addresses." To me (coming originally from a Pascal background), "pointer" is a higher level concept than a machine address, and "pointer" does not imply that address arithmetic is allowed. A pointer is simply something that points. - Bob