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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,9506bdc34331969a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: put of access type References: From: Stephen Leake Date: Fri, 21 Aug 2009 04:31:48 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:V5u8ExaJ5s1D5dnzqGPuaPVJ3E4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: baa534a8e5b5de197caa700564 Xref: g2news1.google.com comp.lang.ada:6965 Date: 2009-08-21T04:31:48-04:00 List-Id: Dennis Lee Bieber writes: > On Thu, 20 Aug 2009 04:09:02 -0400, Stephen Leake > declaimed the following in > comp.lang.ada: > >> >> Why do people insist that the value of an access type must be >> mysterious? There's a lot to be learned this way. > > Because it is not learning Ada as the language... I disagree. Part of learning a language is learning how it works; building a mental model of how the generated code will function. At least for some people. If you have no idea how an access value works, that's a problem. Thinking of it as "mostly an address, but there are exceptions" is a big improvement. It is possible to use only the text of the LRM to come up with a model of how access values "work", independent of any implementation for a particular target architecture. But that's a complex excersize in abstract thinking, well beyond the casual first use of a language. Especially if you are familiar with how other languages work, it can be helpful to know what the implementation of 'access' is for a typical target. > It is learning internal details of a particular Ada compiler > implementation; For mainstream compilers on mainstream processors, an access is an address. Other processors have different mechanisms, but that matters when you start using those processors. And even then, the model of "an access is an address, but addresses are weird" is useful. > there is no promise that the next Ada compiler will do things in the > same way. Maybe some compiler implements access types as pointers to > pointers, allowing not only for garbage collection, but also for > memory free space compaction by shifting the live objects on the > heap and rewriting the intermediate pointer values. Ok. You still have to learn the simple implementation before this makes any sense at all. -- -- Stephe