From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: private types
Date: 25 Mar 2006 20:00:29 -0500
Date: 2006-03-25T20:00:29-05:00 [thread overview]
Message-ID: <wccbqvu58b6.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: AZkVf.1846$b07.929@trnddc05
Justin Gombos <rpbkbq.xax.gld@uluv.kbq> writes:
> On 2006-03-25, Robert A Duff <bobduff@shell01.TheWorld.com> wrote:
> > Justin Gombos <rpbkbq.xax.gld@uluv.kbq> writes:
> >
> > So you rarely create trees, linked list, etc?
>
> That's right. In fact, a few months ago was the first time I
> implemented a dynamic container in Ada since I studied it in school.
> I haven't had a need for them in any of the avionics systems that I've
> worked.
OK. I'm a compiler writer, so I use pointers (access types or whatever)
quite a lot.
> >> Integers, and other non-access scalars are different in this case
> >> because you cannot expect zero to have the same meaning. Zero has
> >> a universal meaning with access types,
> >
> > No, zero has no meaning with access types!
> >
> >>... but it could be in range or out of range for any other type.
> >>The ARM selects access types specifically to get a default
> >>initialization of zero for this reason.
> >
> > There is no "default initialization of zero". There is a
> > default-init to null, which has nothing to do with zero (according
> > to the Ada standard).
>
> You're forgetting why we got side tracked on this discussion.
Sorry. These discussions tend to ramble a bit. ;-)
>...Your
> comment was:
>
> I'm not sure what the right answer is, but surely all the arguments
> for and against dummy values apply equally to access types.
And I stand by that comment.
> Access types are special, and get different treatment than other
> scalars because they include in their set a representation for a null
> value.
Yes, access types in Ada are special, because they have a special null
value. C and Pascal and so forth are similar. But it doesn't HAVE to
be that way. Some languages (SML comes to mind) do not have a special
null value provided for free -- if you want one, you declare one.
(Or, if you want two, you declare two!)
>...Integers do not; so the same arguements for implicit
> initialization of access values do not necessarily apply.
Again, it doesn't have to be that way. The language designer could
provide a special value for integers, too.
Most of the time, I do not want a special null value (neither for access
types nor for integers). I would prefer a language that did not give me
special null values for free -- they're just a tripping hazard, except
when I want them.
The Ada 2005 "not null" thing is somewhat helpful, in this regard.
> Whether null values are actually represented as zeros is irrelevant to
> this matter.
Quite true. Sorry -- I was confused by your referring to zero as a null
access value.
- Bob
next prev parent reply other threads:[~2006-03-26 1:00 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-13 19:58 private types ada_student
2006-03-13 20:27 ` Mark Lorenzen
2006-03-13 21:05 ` Pascal Obry
2006-03-13 21:07 ` ada_student
2006-03-13 21:45 ` Simon Wright
2006-03-14 4:51 ` Jeffrey R. Carter
2006-03-14 7:44 ` Brian May
2006-03-14 8:25 ` Ludovic Brenta
2006-03-14 8:47 ` Alex R. Mosteo
2006-03-17 4:33 ` Justin Gombos
2006-03-17 5:17 ` Brian May
2006-03-17 22:50 ` Justin Gombos
2006-03-18 1:17 ` Randy Brukardt
2006-03-18 2:17 ` Justin Gombos
2006-03-21 0:08 ` Randy Brukardt
2006-03-18 8:39 ` Uninitialized variables (was: Re: private types) Dirk Craeynest
2006-03-18 14:06 ` Gautier
2006-03-18 14:36 ` Uninitialized variables Jeffrey Creem
2006-03-21 0:22 ` Uninitialized variables (was: Re: private types) Randy Brukardt
2006-03-21 0:38 ` Randy Brukardt
2006-03-18 12:06 ` private types Martin Dowie
2006-03-18 12:47 ` Robert A Duff
2006-03-17 7:40 ` Maciej Sobczak
2006-03-17 16:41 ` Frank J. Lhota
2006-03-17 23:36 ` Justin Gombos
2006-03-18 1:32 ` Randy Brukardt
2006-03-18 3:21 ` Handling invalid objects Justin Gombos
2006-03-18 7:35 ` Jeffrey R. Carter
2006-03-18 16:10 ` Justin Gombos
2006-03-19 11:00 ` Simon Wright
2006-03-20 23:57 ` Randy Brukardt
2006-03-22 2:06 ` Justin Gombos
2006-03-22 5:23 ` tmoran
2006-03-22 8:48 ` Dmitry A. Kazakov
2006-03-22 9:24 ` Maciej Sobczak
2006-03-22 11:05 ` Dmitry A. Kazakov
2006-03-22 16:42 ` Maciej Sobczak
2006-03-22 18:06 ` Stefan Lucks
2006-03-23 13:20 ` Dmitry A. Kazakov
2006-03-18 8:57 ` Jacob Sparre Andersen
2006-03-19 19:07 ` Dr. Adrian Wrigley
2006-03-20 15:25 ` Robert A Duff
2006-03-19 22:06 ` Brian May
2006-03-20 21:17 ` Jeffrey R. Carter
2006-03-20 23:44 ` Randy Brukardt
2006-03-22 1:27 ` Justin Gombos
2006-03-18 9:20 ` private types Dmitry A. Kazakov
2006-03-17 13:18 ` Robert A Duff
2006-03-17 23:44 ` Justin Gombos
2006-03-18 9:24 ` Dmitry A. Kazakov
2006-03-18 12:56 ` Robert A Duff
2006-03-18 15:06 ` Justin Gombos
2006-03-19 9:35 ` Martin Krischik
2006-03-19 14:52 ` Peter C. Chapin
2006-03-19 15:08 ` Björn Persson
2006-03-19 16:34 ` Martin Krischik
2006-03-20 9:57 ` Maciej Sobczak
2006-03-20 10:58 ` Peter C. Chapin
2006-03-20 11:19 ` Peter C. Chapin
2006-03-20 13:06 ` Maciej Sobczak
2006-03-20 15:19 ` Robert A Duff
2006-03-20 16:47 ` James Dennett
2006-03-20 19:12 ` Martin Krischik
2006-03-21 7:27 ` Maciej Sobczak
2006-03-20 19:32 ` Martin Krischik
2006-03-21 7:41 ` Maciej Sobczak
2006-03-20 20:29 ` Simon Wright
2006-03-19 17:43 ` Larry Kilgallen
2006-03-19 22:11 ` Peter C. Chapin
2006-03-19 18:15 ` Robert A Duff
2006-03-19 19:20 ` Martin Krischik
2006-03-19 20:43 ` Dr. Adrian Wrigley
2006-03-20 15:01 ` Robert A Duff
2006-03-27 4:07 ` Dave Thompson
2006-03-20 9:40 ` Maciej Sobczak
2006-03-20 15:09 ` Robert A Duff
2006-03-21 8:07 ` Maciej Sobczak
2006-03-26 18:53 ` Robert A Duff
2006-03-19 19:27 ` Jeffrey R. Carter
2006-03-25 21:40 ` Robert A Duff
2006-03-26 0:10 ` Justin Gombos
2006-03-26 1:00 ` Robert A Duff [this message]
2006-03-26 6:37 ` Jeffrey R. Carter
2006-03-26 15:43 ` Justin Gombos
2006-03-26 16:32 ` Robert A Duff
2006-03-26 16:51 ` Robert A Duff
2006-03-26 19:41 ` Jeffrey R. Carter
2006-03-26 3:15 ` Frank J. Lhota
2006-03-26 18:28 ` Robert A Duff
2006-03-26 19:43 ` Jeffrey R. Carter
2006-03-26 19:59 ` Simon Wright
[not found] <bctruong.1.00117123@draper.com>
1999-07-28 0:00 ` Stanley R. Allen
1999-07-28 0:00 ` Thomas Hood
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox