comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: System.Address'Size - not a static integer expression?
Date: 16 Apr 2002 20:22:47 -0700
Date: 2002-04-17T03:22:48+00:00	[thread overview]
Message-ID: <5ee5b646.0204161922.58b2bc49@posting.google.com> (raw)
In-Reply-To: ubmc5dgvl8toba@corp.supernews.com

"Randy Brukardt" <randy@rrsoftware.com> wrote in message news:<ubmc5dgvl8toba@corp.supernews.com>...
 

> The only non-scalar subtype that can be static is a  
> string subtype. That's rare enough that it can be 
> ignored. So, for practical purposes, 'Size is static only 
> for prefixes of static scalar subtypes (which are
> most scalar subtypes).

Oh oh! Now the Ada experts *are* getting confused :-) :-)

Randy, 'Size of a static string subtype is NOT static.
Don't you get confused by Wes misreading of para 7, which
clearly only applies to static *scalar* subtypes.

What are the design principles here?

Basically we only want sizes to be static if the front end
can easily determine them and if they are generally target
independent (the generally here is qualified by the fact that of
course types like Integer are target dependent and
yet Integer'Size is static -- the point being that the dependence here
is not on the compilers treatment of data
layout, but rather on the details of the type declaration).

We definitely do NOT want 'Size applied to a static string
subtype to be static, since in general arrays and records are layed
out by the back end of a compiler in a target dependent manner.

Note that the fact that para 7 says "static scalar subtype"
and not "static subtype" is not an accident, it is very
deliberate :-)

A long and rather involved thread for a not too complex
point, but probably it has some useful byproducts. For sure
I hope no one reading this thread will confuse the technical term
static (expression/subtype etc) with the
informal notion of known-at-compile-time.

Second, it is instructive to see how important it is to read the RM
carefully, and to realize that the language
must be read being alert to the use of technical terms
that are elsewhere defined in the RM.



  reply	other threads:[~2002-04-17  3:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-06 17:57 System.Address'Size - not a static integer expression? Vadim Godunko
2002-03-07  1:21 ` Robert Dewar
2002-03-07 13:56   ` Wes Groleau
2002-03-08 18:34     ` FGD
2002-03-08 19:07       ` Larry Kilgallen
2002-03-08 19:43       ` Wes Groleau
2002-04-08  4:57         ` Robert Dewar
2002-04-08 15:17           ` Wes Groleau
2002-04-10  1:54             ` Robert Dewar
2002-04-10 17:41               ` Wes Groleau
2002-04-10 18:29                 ` Darren New
2002-04-12 20:20                 ` Robert Dewar
2002-04-12 21:10                   ` Wes Groleau
2002-04-14 19:59                     ` Robert Dewar
2002-04-14 20:01                     ` Robert Dewar
2002-04-15 15:13                       ` Wes Groleau
2002-04-15 19:57                         ` Randy Brukardt
2002-04-17  3:22                           ` Robert Dewar [this message]
2002-04-17  3:11                         ` Robert Dewar
2002-04-17 18:27                           ` Wes Groleau
2002-04-19 14:06                             ` Robert Dewar
2002-04-19 15:05                               ` Wes Groleau
2002-04-20  2:26                                 ` Robert Dewar
2002-04-20  5:11                                 ` Robert Dewar
2002-04-20 16:50                                   ` Darren New
2002-04-22  9:20                                   ` Ole-Hjalmar Kristensen
2002-04-22 13:24                                     ` Robert Dewar
2002-04-22 13:59                                       ` Ole-Hjalmar Kristensen
2002-04-22 13:34                                     ` Robert Dewar
2002-04-22 14:02                                       ` Ole-Hjalmar Kristensen
2002-04-22 16:11                                         ` Jean-Pierre Rosen
2002-04-22 23:57                                         ` Robert Dewar
2002-04-08  0:43 ` Nick Roberts
replies disabled

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