comp.lang.ada
 help / color / mirror / Atom feed
From: crispen@eight-ball.boeing.com (Bob Crispen)
Subject: Re: Forcing default representations
Date: Thu, 22 Jul 93 13:34:22 CDT	[thread overview]
Message-ID: <9307221834.AA03070@eight-ball.boeing.com> (raw)

Tucker Taft sez:

>For discrete types, using the type as an index type for an
>array type is a forcing occurrence.

Yup.  I did use it as an index elsewhere, but I thought it was the
thing I gave in my example.  No compiler bug.  Thanks for the
clarification, and I appreciate the trouble.

I certainly understand why the internal values of an enumeration
are frozen when it's used as an index, but not quite sure why its
size is frozen if the array type is constrained.  Oh, well.

By the way, here's a semi-trivial question:  Does anyone know of
a real Ada compiler that doesn't assign internal values of integers
(forget the size for a minute) beginning with zero as a default for
enumerations?  I know you can't rely on it, but is there actually
a compiler or a machine that doesn't do it the obvious way?

It's a pity that we have to put some rep specs in the public part,
since in our case the interface type declarations and object
declarations form the IDD for our program.  We could take a pair
of scissors to those source code listings at the word "private"
with a clear conscience and have one hell of a readable document.

And, definitely non-trivially, can someone explain why some compilers
approve of (and even generate proper code for) the following:

	type Four_Bytes is range 0..31;
	...
	for X use
         record
           Y at 0 range Four_Bytes;
           ...
        end record;

and some don't?
+----------------------------+-----------------------------------------+
| Bob Crispen                | You guys start coding.  I'll go see     |
| crispen@foxy.boeing.com    | what they want.                         |
+----------------------------+-----------------------------------------+

             reply	other threads:[~1993-07-22 18:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-22 18:34 Bob Crispen [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-07-30 12:00 Forcing default representations Bob Gilbert
1993-07-30  1:15 pipex!warwick!zaphod.crihan.fr!univ-lyon1.fr!scsing.switch.ch!epflnews!di
1993-07-26 18:30 Robert I. Eachus
1993-07-26 15:12 agate!howland.reston.ans.net!europa.eng.gtefsd.com!news.ans.net!newsgate.watson.ibm.com!yktnews.watson.ibm.com!ncohen
1993-07-24 21:16 Erik Magnuson
1993-07-24 17:13 pipex!sunic!news.funet.fi!funic!news.eunet.fi!prime!mits!rkaivola
1993-07-23 19:15 Gary Morris @ignite
1993-07-20 12:57 Bob Crispen
1993-07-19 16:56 Adam Beneschan
1993-07-16 22:26 dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!noc.near.net
1993-07-13 19:22 crispen
replies disabled

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