V
Valentin Tihhomirov
Guest
Is it the immediate predecessor of the subtype or it is the root,
declared by type_definition or predefined superroot (e.g.
$universal_integer)?
From the
qualified_expression ::= type_mark ' ( expression )
and statement *"The operand shall have the same type as the base typeof
the type mark"* it follows that the base type is the root because
literals are of the root type rather than immediate predcessor.
On the other hand, the "Subtypes" section in Ashenden creates an
impression that the base base type is not the root but immediate
predecessor: "We can represent such objects by declaring a subtype,
which defines a restricted set of values from a base type.. The sub-type
declaration defines the identifier as a subtype of the base type
specified by the type mark" And, I see in the "Type Declarations"
section, which remarks that two declared types with are different
despite the same definition, does not mention that declarations define
the base types.
LRM Section on types does not clarify the things:
"A subtypeis a type together with a constraint. A value is said to
belong to a subtypeof a given type if it belongs to the type and
satisfies the constraint; the given type is called the base typeof the
subtype. A type is a subtype of itself; such a subtype is said to be
unconstrained (it corresponds to a condition that imposes no
restriction). The base type of a type is the type itself."
Apart from that, what is the point of defining both type and subtype,
("array_definition defines both an array type and a subtype of this type")?
declared by type_definition or predefined superroot (e.g.
$universal_integer)?
From the
qualified_expression ::= type_mark ' ( expression )
and statement *"The operand shall have the same type as the base typeof
the type mark"* it follows that the base type is the root because
literals are of the root type rather than immediate predcessor.
On the other hand, the "Subtypes" section in Ashenden creates an
impression that the base base type is not the root but immediate
predecessor: "We can represent such objects by declaring a subtype,
which defines a restricted set of values from a base type.. The sub-type
declaration defines the identifier as a subtype of the base type
specified by the type mark" And, I see in the "Type Declarations"
section, which remarks that two declared types with are different
despite the same definition, does not mention that declarations define
the base types.
LRM Section on types does not clarify the things:
"A subtypeis a type together with a constraint. A value is said to
belong to a subtypeof a given type if it belongs to the type and
satisfies the constraint; the given type is called the base typeof the
subtype. A type is a subtype of itself; such a subtype is said to be
unconstrained (it corresponds to a condition that imposes no
restriction). The base type of a type is the type itself."
Apart from that, what is the point of defining both type and subtype,
("array_definition defines both an array type and a subtype of this type")?