On Tue, 15 Apr 2008 19:51:17 -0700 (PDT), Eric Hughes wrote:
> On Tue, 15 Apr 2008 07:20:15 -0700 (PDT), Eric Hughes wrote:
>> Perhaps you could explain what you want universal_integer to be.
>
> On Apr 15, 9:23 am, "Dmitry A. Kazakov" <mail...@[EMAIL PROTECTED]
>
> wrote:
>> Merely the type of a static numeric expression. Well, it isn't, a
>> counterexample is:
>>
>> A'Length (ARM 3.6.2)
>
> The fact that lengths are limited does not mean that their values
> cannot sit within a type whose values are not. The set of possible
> values of lengths for a certain compiler are a subset of the values of
> universal_integer.
A'Length is of Universal_Integer.
>> Universal_Integer is not necessarily Root_Integer, but somewhere close
to
>> the root of Root_Integer'Class.
>
> "Somewhere close" is not a definition. Please be more specific.
It is specific. "Close" means: a small tree distance to Root_Integer.
(Tree
is the type inheritance tree.)
>>> If you can show me a Ada definition that can store a
>>> universal_integer, only then will I believe you that it's the kind of
>>> type that's just like an ordinary Ada type.
>>
>> type T is abstract private;
>>
>> Can you store T?
>
> By ordinary type, I mean the kind that's assignable, not abstract, not
> an interface, something you can declare a variable of.
So, actually, the whole point is that we could not have a variable of
Universal_Integer?
It is not uncommon. I cannot have a variable of a constant Boolean.
X : constant Boolean := False;
begin
X := True; -- Illegal, "constant" disallows ":="
Maybe it is indefinite types which worry you? Yes, I cannot have a
variable
of String:
X : String; -- Illegal, no constraint given
There is nothing special in Universal_Integer except that it lacks some
"primitive" operations, an Integer possess.
The only really interesting property of Universal_Integer is that its
constants are required to be static. I would allow such constraints for
any
types, in order to introduce static compilation units (functions,
packages,
maybe, procedures).
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


|