comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: put of access type
Date: Fri, 21 Aug 2009 04:31:48 -0400
Date: 2009-08-21T04:31:48-04:00	[thread overview]
Message-ID: <u1vn5wosr.fsf@stephe-leake.org> (raw)
In-Reply-To: GoydnWoDmpUW4BDXnZ2dnUVZ_rKdnZ2d@earthlink.com

Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:

> On Thu, 20 Aug 2009 04:09:02 -0400, Stephen Leake
> <stephen_leake@stephe-leake.org> 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



  parent reply	other threads:[~2009-08-21  8:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-18 22:26 put of access type Rob Solomon
2009-08-18 23:17 ` Jeffrey R. Carter
2009-08-19  3:36   ` Rob Solomon
2009-08-19  7:44     ` Jean-Pierre Rosen
2009-08-20  8:06       ` Stephen Leake
2009-08-19 11:16     ` Robert A Duff
     [not found]     ` <k_2dncb9WoxvFRbXnZ2dnUVZ_jmdnZ2d@earthlink.com>
2009-08-20  8:05       ` Stephen Leake
2009-08-20 15:42         ` Adam Beneschan
2009-08-21  8:24           ` Stephen Leake
2009-08-19  6:25 ` Martin Krischik
2009-08-19  7:21 ` Dmitry A. Kazakov
2009-08-19 19:00   ` Rob Solomon
2009-08-19 19:44     ` sjw
2009-08-20  1:54       ` Rob Solomon
2009-08-20  2:06         ` Rob Solomon
2009-08-20 15:18         ` (see below)
2009-08-19 21:01     ` Adam Beneschan
2009-08-19 22:45       ` Randy Brukardt
2009-08-20  6:18         ` Martin Krischik
2009-08-21  0:18           ` Randy Brukardt
2009-08-21  1:20             ` Adam Beneschan
2009-08-21 14:47             ` Robert A Duff
2009-08-21 21:43               ` Randy Brukardt
2009-08-22  0:07                 ` Robert A Duff
2009-09-01  1:57                   ` Randy Brukardt
2009-08-20  6:08     ` Martin Krischik
2009-08-20 20:57     ` Robert A Duff
2009-08-20  6:01   ` Martin Krischik
2009-08-20 17:54     ` tmoran
2009-08-31  7:08       ` Martin Krischik
2009-08-20 18:58     ` Dmitry A. Kazakov
2009-08-20 22:27       ` sjw
2009-08-21  7:29         ` Dmitry A. Kazakov
2009-08-21 21:09           ` sjw
2009-08-31  7:12             ` Martin Krischik
2009-08-20 20:29     ` Robert A Duff
2009-08-21  8:18       ` Stephen Leake
2009-08-21 14:31         ` Robert A Duff
2009-08-21 14:41         ` Robert A Duff
2009-08-22 12:02           ` Stephen Leake
2009-08-20  8:09   ` Stephen Leake
     [not found]     ` <GoydnWoDmpUW4BDXnZ2dnUVZ_rKdnZ2d@earthlink.com>
2009-08-21  8:31       ` Stephen Leake [this message]
2009-08-21  8:42         ` Dmitry A. Kazakov
replies disabled

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